Skip to main content
Voice and text chat powered by LiveKit.

Constructor

Methods

async join()

Join the voice chat room. Fetches a token, connects to the LiveKit server, subscribes to audio, and enables the mic if configured.

async leave()

Disconnect from the room.

async toggleMic()

Toggle the local microphone on or off.

sendMessage(text)

Send a text message to all participants in the room.

async muteAllRemote()

Mute all remote participants locally (you stop hearing them).

async unmuteAllRemote()

Unmute all remote participants locally.

async muteSelected(identity)

Mute a specific participant locally.

async unmuteSelected(identity)

Unmute a specific participant locally.
All mute/unmute operations (muteAllRemote, unmuteAllRemote, muteSelected, unmuteSelected) are local only. They control what you hear, not what other participants hear. Other users are not affected.

onMessage(callback)

Register a callback for incoming messages (including your own).
Callback data:

onParticipantUpdate(callback)

Register a callback for participant list changes and speaking state updates.
Callback data:

Next steps

Voice and text chat guide

End-to-end guide with full usage examples.

SFU streaming

Pair voice chat with one-to-many SFU sessions.