Hosted Experience

Methods

30min

Once you've created an instance of Uneeq, you can interact with it to control behaviour dynamically. The below methods are available on your Uneeq instance (e.g. uneeqInstance.

You can learn more about Uneeq options: Configuration Options

JS



Methods

init()

Initializes the Uneeq instance by validating options and setting up the message event handler.

JS



cameraAnchorHorizontal(position, duration)

Requests the camera to move to a specified anchor position.

Parameters

  • position (string): The desired camera anchor position. 'left' | 'right' | 'center' | 'close_up' | 'loose_close_up' | 'tight_medium_shot' | 'medium_shot' | 'medium_full_shot' | 'full_shot'
  • duration (number): The duration for the camera movement in milliseconds.
JS



cameraAnchorDistance(position, duration)

Requests the camera to move to a specified anchor position.

Parameters

  • position (string): The desired camera anchor position. 'close_up' | 'loose_close_up' | 'tight_medium_shot' | 'medium_shot' | 'medium_full_shot' | 'full_shot'
  • duration (number): The duration for the camera movement in milliseconds.
JS



chatPrompt(prompt)

Sends a chat prompt to the digital human.

Parameters

prompt (string): The chat prompt message.

JS



speak(speech)

Sends a speak request to the digital human.

Parameters

speech (string): The text to be spoken by the digital human.

JS



enableMicrophone()

Enables the user's microphone for audio recording.

JS



endSession()

Ends the current session.

JS



pauseSpeechRecognition()

Pauses speech recognition processing. This is equivilent to muting the users microphone.

JS



resumeSpeechRecognition()

Resumes speech recognition processing. This is equivilent to un-muting the users microphone.

JS



setCustomPromptMetadata(customMetadata)

Sets custom metadata for chat prompts.

Parameters

customMetadata (Object): The custom metadata for chat.

JS



setLayoutMode(layoutMode)

Sets the layout mode of the interface.

Parameters

layoutMode (string): 'overlay' | 'fullScreen' | 'contained'

JS



stopSpeaking()

Instructs the digital human to stop speaking.

JS



unmuteDigitalHuman()

Unmutes the digital human if the browser has muted it due to auto-play policy.

JS



muteDigitalHuman()

Mutes the digital human. You must call unmuteDigitalHuman() to receive audio again. There is no on screen indicator of this muted state.

JS



updateDisplayContent(htmlContent)

Sets HTML content to be displayed in the content window.

Parameters

htmlContent (string): The HTML content to display.

JS



setShowClosedCaptions(show)

Sets whether closed captions are displayed.

Parameters

show (boolean): True to show closed captions, false otherwise.

JS



setShowUserInputInterface(show)

Sets whether the user input interface (text/voice input UI) is displayed.

Parameters

show (boolean): True to show the user input interface, false otherwise.

JS



startSession()

Starts a session with the digital human.

JS