TextSync Node Library
Server side library for TextSync. It's useful for generating tokens in the format expected by the TextSync client library when an authorization endpoint is configured.
Usage
Importing
It's possible to import textsync-server-node
using ES6 modules.
;
Commonjs is supported too.
const TextSync = ;
Instantiation
The constructor takes a single options object with the following required keys:
instanceLocator
key
Both of which should be available from the keys page of your TextSync dashboard.
let instance = instanceLocator: INSTANCE_LOCATOR key: KEY;
Authorization
instance;
requestData
(required) - body of the request from the client librarypermissionsFn
(required) - a function returning a promise resolving to the permissions the user making the request has todocId
. The library exposes the available permissions (at present there is onlyTextSync.Permissions.READ
andTextSync.Permissions.WRITE
)options
(optional) - an object containing authorization options. At present the only option availabletokenExpiry
Example
const TextSync = ;const express = ;const bodyParser = ; const app = ;app; let textSync = locator: INSTANCE_LOCATOR key: KEY; app;