Build Your Own experience
SDK Reference

SDK Messages

48min

While your digital human is being used, there are a number of messages that may be emitted via UneeqOptions => messageHandler. The following document describes these messages in detail.



AvatarAnswerContentMessage

The avatar's answer to a question (HTML Content). uneeqMessageType: "AvatarAnswerContent"

content: string If hasDisplayHtml = true, this content will contain the HTML provided by the displayHTML instruction. If hasDisplayHtml = false, this content will contain the answer value.

hasDisplayHtml: boolean

transcriptId: string









AvatarAnswer

The avatar's answer to a question.

uneeqMessageType: "AvatarAnswer"

answer: string

answerAvatar: string

answerSpeech: string

transcriptId: string







AvatarAvailable

An avatar is available.

uneeqMessageType: "AvatarAvailable"







AvatarQuestion

The question the user asked.

uneeqMessageType: "AvatarQuestion"

question: any

transcriptId: any







AvatarRequestCompleted

The Avatar has completed processing a text or instruction request.

uneeqMessageType: "AvatarRequestCompleted"

reason: string







AvatarRequestIgnored

The Avatar has ignored a request to speak.

uneeqMessageType: "AvatarRequestIgnored"

reason: string







AvatarTextInputFinished

[Deprecated] Avatar has finished speaking the message. Deprecated, use FinishedSpeaking

uneeqMessageType: "AvatarTextInputFinished"







AvatarUnavailable

There are no avatars currently available.

uneeqMessageType: "AvatarUnavailable"







ClientMediaStreamUpdate

Provides streaming status updates for both client and server side.

uneeqMessageType: "ClientMediaStreamUpdate"

clientStreamingAudio: boolean

clientStreamingVideo: boolean

serverStreamingVideo: boolean

serverStreamingAudio: boolean







ClientPerformanceMessage

These WebRTC statistics help identify if session quality is being impacted by client-side conditions. Messages are sent every 5 seconds, and are visible in the console if enableClientPerformanceMessage = true.

uneeqMessageType: "ClientPerformanceMessage"

clientPerformance: ClientPerformanceStats







ConnectionLost

Connection has been lost.

uneeqMessageType: "ConnectionLost"

connectionState: PublishSubscribeState







CustomMetadataUpdated

There are no avatars currently available.

uneeqMessageType: "CustomMetadataUpdated"

chatMetadata: string







DeviceError

An error has occurred with the users device.

uneeqMessageType: "DeviceError"

error: Error







DeviceListUpdated

The device list has been changed or retrieved for the first time.

uneeqMessageType: "DeviceListUpdated"

devices: Devices







DeviceNotFoundError

Selected device is not found.

uneeqMessageType: "DeviceNotFoundError"

deviceId: string

msg: string







DevicePermissionAllowed

User has given permission to use devices.

uneeqMessageType: "DevicePermissionAllowed"







DigitalHumanUnmuted

The digital human has been unmuted. You will also receive this message at the start of a session if the digital human starts unmuted.

uneeqMessageType: "DigitalHumanUnmuted"







EnableMicrophoneUpdated

The microphone enabled state has updated. If the enabled valued is true, then the microphone has been enabled. If the enabled value is false, then the microphone has been released.

uneeqMessageType: "EnableMicrophoneUpdated"

enabled: boolean







FinishedSpeaking

Digital human has finished speaking the message.

uneeqMessageType: "FinishedSpeaking"







Instructions

Instructions payload has been sent from NLP. Instructions may be set within your NLP as JSON.

uneeqMessageType: "Instructions"

instructions: JSON stringified object containing the content set within your NLP JSON field.







MicActivityError

An error occurred with mic activity messages.

uneeqMessageType: "MicActivityError"







MicActivity

Message is sent upon activity of the user microphone.

uneeqMessageType: "MicActivity"

level: integer







MicActivityNotSupported

Mic activity messages are not supported by the users browser.

uneeqMessageType: "MicActivityNotSupported"







OnlineStatusUpdate

Clients network status has changed.

uneeqMessageType: "OnlineStatusUpdate"

online: boolean







Ready

Service is ready to be used.

uneeqMessageType: "Ready"







RecordingStarted

User has started a recording successfully.

uneeqMessageType: "RecordingStarted"







RecordingStopped

User has stopped recording successfully.

uneeqMessageType: "RecordingStopped"







ServiceUnavailable

Service is unavailable.

uneeqMessageType: "ServiceUnavailable"

error: any







SessionEnded

Session has been ended successfully.

uneeqMessageType: "SessionEnded"







SessionError

A session error has occurred.

uneeqMessageType: "SessionError"

error: string







SessionInfo

Session info message used for testing.

uneeqMessageType: "SessionInfo"

info: string







SessionLive

Session is Live, avatar video is active.

uneeqMessageType: "SessionLive"







SessionPaused

Session has been paused successfully.

uneeqMessageType: "SessionPaused"







SessionResumed

Session has been resumed successfully.

uneeqMessageType: "SessionResumed"







SetCameraSuccess

Users camera has been set successfully.

uneeqMessageType: "SetCameraSuccess"

deviceId: string







SetMicSuccess

Users microphone has been set successfully.

uneeqMessageType: "SetMicSuccess"

deviceId: string







SetSpeakerSuccess

Users speaker has been set successfully.

uneeqMessageType: "SetSpeakerSuccess"

deviceId: string







StartedSpeaking

Digital human has started speaking a message.

uneeqMessageType: "StartedSpeaking"







SessionError

An error occurred in the session. Refer to provided message.

uneeqMessageType: "SessionError"

error: string







SpeechTranscription

A speech transcription event occurred.

uneeqMessageType: "SpeechTranscription"

speechTranscription: SpeechTranscriptionResult

SpeechTranscriptionResult { confidence: number; // value between 0 - 1 final: boolean; // is this a completed transcript result or interim language_code: string; // the detected locale spoken by user transcript: string; // the transcribed audio into text }







UserStartedSpeaking

When using SPEECH_RECOGNITION voiceInputMode this message indicates that the user has started speaking.

uneeqMessageType: "UserStartedSpeaking"







UserStoppedSpeaking

When using SPEECH_RECOGNITION voiceInputMode this message indicates that the user has stopped speaking.

uneeqMessageType: "UserStoppedSpeaking"







Warning

General warning message.

uneeqMessageType: "Warning"

msg: string







WebRtcData

WebRTC data channel message.

uneeqMessageType: "WebRtcData"

data: any







WebRtcStats

WebRTC stats message (diagnostics).

uneeqMessageType: "WebRtcStats"

stats: any