website logo
⌘K
Overview
Hosted experience overview
Getting started
Customizing your experience
Displaying content
Methods
Keeping your experience secure
Event handling
Build Your Own experience
SDK Reference
Obtaining an access token
Conversation platform integrations
Unsolicited Responses
Personality Engine
Digital human instructions
Frequently Asked Questions
Docs powered by archbee 
26min

SDK Methods



Constructor

new Uneeq(options: UneeqOptions)

Construct a new Uneeq object. See SDK UneeqOptions for constructor parameter details.

Parameters: options: SDK UneeqOptions

Returns Uneeq







sessionId

sessionId

The active session id as a string. If the session has not started yet value will be null. Note, this is an accessor and not a method. You can retrieve the value by accessing it as a property of Uneeq, e.g. Uneeq.sessionId.

Parameters: no parameters

Returns string | null







enableMicrophone

enableMicrophone(enable?: <boolean>, foo?: <boolean>)

Enable or disable the users microphone.

Parameters: enable: boolean (optional) Defaults to true foo: string (optional) Defaults to false

Returns void







endSession

endSession()

Ends the session, releases the microphone and camera and ends the avatar process. On success, SessionEndedMessage will be sent. On error, ErrorEndingSessionMessage will be sent.

Parameters: no parameters

Returns void







initWithToken

initWithToken(tokenId: string)

Initialise the session. ReadyMessage will be sent when init is ready. initWithToken should be used instead of init() when a third party conversation service is used.

Parameters: tokenId: string

Returns Promise<void>

Note: In order to avoid browser autoplay restrictions, you must call initWithToken as part of a mouse or keyboard event chain. Calling initWithToken before the user has interacted with the page may cause the session to be started with the digital human audio muted. When this occurs you will receive a message DigitalHumanPlayedInMutedModeSuccess. You will need to call unmuteDigitalHuman after the user has interacted with the page to unmute the digital human. Alternatively the user may click the digital human video to unmute audio.







unmuteDigitalHuman

unmuteDigitalHuman()

Use this method to unmute a digital human that was started in muted mode. If your digital human was started in muted mode due to browser autoplay policy you will receive a message DigitalHumanPlayedInMutedModeSuccess.

Parameters: no parameters

Returns void







pauseSession

pauseSession()

Pauses a live session. Local video and audio will stop being sent and remote avatar video audio will be stopped. On success, SessionPausedMessage will be sent.

Parameters: no parameters

Returns boolean







playWelcomeMessage

playWelcomeMessage()

Trigger this conversation's welcome message.

Parameters: no parameters

Returns Promise<void>







resumeSession

resumeSession()

Resumes a live session. Local video and audio will start being sent again and remote avatar video audio will be restarted. On success, SessionResumedMessage will be sent.

Parameters: no parameters

Returns boolean







sendTranscript

sendTranscript(text: string)

Send a text based message to the digital human.

Parameters: text: string

Returns void







setAvatarDebug

setAvatarDebug(enabled: boolean)

Show Avatar Debugging.

Parameters: enabled: boolean

Returns Promise<any>







setCamera

setCamera(deviceId: string)

Set a preferred camera to use in a live session. On success, SetCameraSuccessMessage will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.

Parameters: deviceId: string

Returns void







setMic

setMic(deviceId: string)

Set a preferred microphone to use in a live session. On success, SetMicSuccessMessage will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.

Parameters: deviceId: string

Returns void







setSpeaker

setSpeaker(deviceId: string)

Set a preferred speaker to use in a live session. On success, SetSpeakerSuccessMessage will be sent. DeviceNotFoundErrorMessage will be sent when the requested device is not found.

Parameters: deviceId: string

Returns void







startRecording

startRecording()

Start Recording voice audio through microphone. Call this method before using voice to speak to avatar. stopRecording should be called when finished speaking.

Parameters: no parameters

Returns void







stopRecording

stopRecording()

Stop Recording voice audio through microphone. Call this method after startRecording has been called.

Parameters: no parameters

Returns void







stopSpeaking

stopSpeaking()

Stop the avatar from speaking. This will stop avatar speaking even if interrupts are turned off. When successful a corresponding AvatarRequestCompleted should be received.

Parameters: no parameters

Returns Promise<void>









UP NEXT
SDK Messages
Docs powered by archbee 
TABLE OF CONTENTS
Constructor
sessionId
enableMicrophone
endSession
initWithToken
unmuteDigitalHuman
pauseSession
playWelcomeMessage
resumeSession
sendTranscript
setAvatarDebug
setCamera
setMic
setSpeaker
startRecording
stopRecording
stopSpeaking