constructor
Create a new Upgrade Client for communicating to server
constructor(userId, hostUrl, options)
Arguments
userId (String): Id of user
hostUrl (String): Url of the upgrade server
options (Object): (Optional)
token (String): JWT Bearer token for the Upgrade Server Header (Optional)
clientSessionId (String): SessionId of application. If not provided, it will create a new sessionId(uuid) (Optional)
Example
Note: We set CLIENT_API_KEY
and CLIENT_API_SECRET
in the deployed Upgrade backend which are used for the authentication. The JWT Token is signed using the environment variable CLIENT_API_KEY
and is passed in the constructor. We then verify this token's authentication in the ClientLibMiddleware against the CLIENT_API_SECRET
Last updated