Skip to main content
LiveKit Agents handles the realtime media and agent session layer. orb-ui handles the browser Room, microphone and agent audio, normalized conversation state, and the visible React UI. The token-endpoint example below is the intended application setup. The dedicated LiveKit entrypoint imports the official SDK only for LiveKit users and hides its mechanical constructors and audio analyser setup. Existing-room, raw credential, and custom fetcher modes remain advanced alternatives.

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 from orb-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 expose start 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’s lk.agent.state attribute and maps LiveKit state into orb-ui state:
  • speaking -> speaking
  • thinking -> thinking
  • listening and idle -> listening
  • connecting, pre-connect-buffering, and initializing -> connecting
  • disconnected -> idle
  • failed -> error
LiveKit remote agent audio is attached when available. The recommended browser entrypoint creates the SDK audio analysers automatically: the local microphone emits normalized 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 partial inputVolumeCalibration or outputVolumeCalibration overrides, or a getter when a generated profile should update during a live session:
See volume calibration for anchor semantics, input/output overrides, and the guided profile generator.

Token handling

Do not create LiveKit access tokens in the browser. Point tokenEndpoint 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.

Controlled mode

If your app already normalizes LiveKit state and volume, pass those values directly as a signal.
Last modified on August 11, 2026