hide-ui to build your own messaging UI. The widget exposes the following methods on the custom element:
Audio Control (Speaker)
mute(): Mute the speaker/audio output (returnsPromise<void>)unmute(): Unmute the speaker/audio output (returnsPromise<void>)isMuted(): Check if audio is currently muted (returnsboolean)canUnmute(): Check if audio can be unmuted (returnsboolean)
Microphone Control
micOn(): Turn on the microphone. This will automatically start the room if not already started (returnsPromise<void>)micOff(): Turn off the microphone (returnsPromise<void>)isMicOn(): Check if microphone is currently on (returnsboolean). Currently always returns true.canTurnOnMic(): Check if microphone can be turned on (returnsboolean) Currently always returns true.
Message Sending
sendMessage(message: string): Send a message to the agent. This will automatically start the room if not already started (returnsPromise<void>)
Notes
micOn()andsendMessage()will automatically:- Set user interaction flag
- Ensure widget is in active state
- Create a room if one doesn’t exist
- Join the room if not already joined
