Chat SDK Provisioning and Authentication
Overview
Provisioning Chat Integration
The Account Administrator must first create a Chat Integration. A Chat Integration represents the entry point for chats related to a business function. Various configurations that define how a chat will be treated in the contact center, like routing queues, routing attributes, orchestration workflows and context data matching rules, are associated with a Chat Integration. Multiple Chat Integrations can be created in a Avaya Experience Platform™ Account to represent various business functions.
To create a chat integration:
- Go to your Avaya Experience Platform™ Administration application
- Sign in as an Account (Tenant) Administrator
- Navigate to Channels > Chat and select "Create Integration".
- Provide the "Name" of the integration and click "Save".
- Once the integration is saved successfully, an "Integration Id" field will appear.
The value in this "Integration Id" field will be required by both the backend web application server (to generate the JWT) and the client (to initialize the Chat SDK).
Authentication
The Chat SDK requires a JSON Web Token (JWT) to initialize and connect to Avaya Experience Platform™ Digital services. A unique token must be used for each end user (your customers using the chat client). Since your backend web application is aware of the user using your services, it should securely fetch the token from Avaya Experience Platform™ Digital for the user whenever your web page requires it.
In order to fetch the JWT from Avaya Experience Platform™ Digital, the backend web application server needs to invoke the Generate JWT Token API. The backend web application server must authenticate and have a valid Access Token and an Application Key (appkey
) before using this API. See here for details. The Access Token or any credentials except the generated JWT and the appkey
should not be shared with your client application or included directly into source code.
It is not recommended to include the appkey
directly in the source code of your client application, instead it can be returned alongside the JWT from your client application's backend or by any other secure means.
Users using your web application services can be categorized into verified (authenticated or logged-in) and unverified (guest) users.
While invoking the API to generate the JWT, the backend web application can specify if the token is being generated for a verified user by setting verifiedCustomer
to true
. For verified users, the backend web application must set the customerId
to a value it uses to identify or trace the user so that Avaya Experience Platform™ Digital is also able the trace multiple sessions of the same user. It should also pass valid information in the customerIdentifiers
field so that Avaya Experience Platform™ is able to build the Customer Journey across multiple channels.
For unverified users, if the backend application does not have any id for the user, it can set the customerId
to a random Id as customerIdentifiers
are ignored for unverified users.
The JWT is short lived and expires after 15 minutes. The Chat SDK will raise a TOKEN_EXPIRY_REMINDER
event 3 minutes before the token expiry time so that your web page can handle this event and request your backend web application to get a new token.
Using the Chat SDK
Once the JWT for the user is available, you can now initialize the Chat SDK for a Chat Integration. This creates a new session for the user on Avaya Experience Platform™ Digital. If the user accesses your web page that initializes the Chat SDK from multiple devices or browsers and the same customerId
is used while generating the JWT, then multiple sessions will be created for the same user.
The Chat SDK provides methods with which your web page can allow the user to start a new chat, join an existing chat that might have been started in a different session and converse with the contact center seamlessly across multiple sessions. A user can create multiple chats and converse over them at the same time if your business requires it to do so.
The Chat SDK also provides a mechanism using which your web page can register handler functions for events that occur on the session as well as events for chats that have been connected from the session.
Updated about 2 months ago