UneeQ makes available our uneeq-js SDK, which allows you to integrate a digital human experience into your website or web application according to your standards. The SDK facilitates communication between that web application and the Platform, and allows you to have full control over your Digital Human implementation.
In order to start a conversation with a digital human you need to create a new instance of the Uneeq class with an options parameter.
The token used in the initWithToken() method is the one time use token received when your chatbot platform requests a token. Obtain an access token
The options parameter tells the UneeQ platform all the information it needs to know to start the conversation. It needs to contain the following properties:
The ID which identifies the Persona that you wish to start a conversation with. You can find your personaId within the Personas area of the UneeQ Creator. Otherwise, our Customer Success team can provide you with this ID.
The URL to the region of the UneeQ platform where your Persona is provisioned. You can find a list of our URLs here.
The HTML Div element that the digital human video will be presented in.
The HTML Div element that the user's local camera will be presented in. If you don't wish to display the user's camera, you can use the value document.createElement('div')
Your method which handles real-time message objects from the UneeQ platform
Play welcome message. Optional boolean. Default is false.
Defines whether the users local video stream (camera) should be sent on session start. Boolean. If true, the user will need to allow permission to use their device. Default value is true.
Defines whether the users local audio stream (microphone) should be sent on session start. If true, the user will need to allow permission to use their device. Boolean. Default value is true.
When initializing a Digital Human session, you need to provide the URL where your Digital Human is provisioned.
If you have access to the UneeQ Creator, you can find the correct URL in the Deploy > Build your own area.
Otherwise, please contact your Customer Success representative if you're unsure of the region in which your Digital Human has been provisioned.
To enable this you need to call the startRecording() and stopRecording() methods at the beginning and end of the period of time you want to capture. The example below enables the user to use the spacebar to talk:
The specific payloads of messages are defined in the uneeq-js SDK reference documentation.
The SDK supports Chrome on both Windows 10 and MacOS (High Sierra or later) and Safari on MacOS. It also supports Chrome on Android (6.0 and above) and Safari on iOS (11 or higher) for mobile browsers.
The SDK's browser support is actively maintained for the most recent version of these browsers running on the most recent version of the given operating systems unless otherwise specified.
At times when an error occurs during the session with the Digital Human, you will receive a SessionErrorMessage(error: string). These are not always fatal and could be a temporary error such as an intermittent network connection. However, it is important to monitor these session error messages for any fatal errors so that your experience can cater to these scenarios accordingly. The following error messages are fatal:
When you receive a ConnectionLostMessage(connectionState: PublishSubscribeState) message, this means that a fatal error has occurred and the connection to the Digital Human has been lost. Your user experience should inform the user that their session has ended due to an error.
You may receive a SessionEndedMessage() if a fatal session error message has been received. If you have not called SDK.endSession() and you receive this message, you will need to inform the user that their session has ended due to an error.