Skip to main content
Web Only: The AvatarKit RTC client path is currently available for Web applications only.
This page covers the Web client side of LiveKit Agents Integration. The client joins the LiveKit room and renders the avatar’s audio and motion stream produced by the LiveKit Agents worker with livekit-plugins-spatius. This page uses the RTC Adapter with the LiveKit provider. LiveKit Agents is the platform integration; the RTC Adapter (@spatius/avatarkit-rtc) is the Web client adapter used to render the avatar stream from the LiveKit room.
When using the AvatarKit RTC client, do not call new Room() from livekit-client yourself. @spatius/avatarkit-rtc creates and owns the LiveKit Room internally so it can wire audio, avatar motion data, and lifecycle handling correctly. If you need access to the underlying Room instance for advanced LiveKit features, see Native Client Access.

AvatarPlayer API

Code in this section shows type signatures, not copy-paste examples. For runnable code, see the Complete Example at the bottom of the page.

Constructor

LiveKitProviderOptions

Most integrations use new LiveKitProvider() without options. Set these only when your LiveKit transport publishes motion data under custom publication names.

AvatarPlayerOptions

Connection

LiveKitConnectionConfig

Microphone Control

Custom Audio Publishing

For non-microphone audio sources like audio elements or Web Audio API.
unpublishAudio() does not stop the track. You are responsible for calling track.stop() to release the resource.

Native Client Access

Access the underlying LiveKit Room instance for advanced features.

ConnectionState

Events

When a stalled event fires, the avatar automatically transitions to idle animation. Consider calling player.reconnect() to recover.

Session diagnostics

sessionSummary is a read-only diagnostics snapshot for the current AvatarPlayer lifetime. Use it when investigating RTC playback health, including packet ordering, recovery, skipped playback, and stalled playback behavior. The object shape is SDK-owned diagnostics data, so avoid depending on individual fields for core application state. Stall recovery example:

Complete Example

Browser Compatibility