Install
Install orb-ui and the LiveKit client package used by your app:Use a token endpoint
In the recommended setup, your app exposes a token endpoint and the adapter fetches fresh LiveKit connection details when the orb starts. Use LiveKit’s TokenSource endpoint contract: the JSON response includes{ server_url, participant_token }. The adapter generates a unique
orb-<uuid> room name for every start.
agentName is optional when your token endpoint already decides which agent to dispatch. Override
roomName only when your app needs a specific room:
Use a LiveKit Cloud sandbox
For local and preview testing, LiveKit’s sandbox token server can generate connection details without your own backend. Do not use this mode in production.Advanced connection ownership
Import fromorb-ui/adapters when your application already owns the connection fetcher, Room,
token source, or runtime helpers. For example, a custom connection fetcher can inspect your own
application state:
Use an existing room
Use an existing room when your app already owns the LiveKit lifecycle. The adapter subscribes to room state but does not exposestart or stop.
Use raw connection details
Raw credentials are supported as an advanced escape hatch. Generate participant tokens on your server, keep them short-lived, and avoid hard-coding them in browser bundles.State mapping
The adapter reads the agent participant’slk.agent.state attribute and maps LiveKit state into orb-ui state:
speaking->speakingthinking->thinkinglisteningandidle->listeningconnecting,pre-connect-buffering, andinitializing->connectingdisconnected->idlefailed->error
inputVolume while
the agent is listening, and remote agent audio emits normalized outputVolume while the agent is
speaking. The adapter supplies a speech-oriented decibel range to LiveKit’s analyser instead of
using its narrow defaults, then maps each direction into the standard orb-ui speech envelope.
Directional calibration
LiveKit ships with separate microphone and agent-output profiles. Most applications should use the defaults. For an unusual audio path, pass partialinputVolumeCalibration or
outputVolumeCalibration overrides, or a getter when a generated profile should update during a
live session:
Token handling
Do not create LiveKit access tokens in the browser. PointtokenEndpoint at a server-backed route
that generates short-lived participant tokens. TokenSource and getConnectionDetails remain
available through the advanced entrypoint when your application needs to own that behavior.