@spatius/avatarkit-rtc is the Web RTC transport adapter for AvatarKit. It lets a browser app render a Spatius avatar from an RTC room by connecting to the room, playing the remote audio track through WebRTC, and feeding motion data into @spatius/avatarkit.
What it is
The RTC Adapter is part of the Web SDK family, not a standalone cross-platform SDK and not a diagnostic tool. Native Agora Convo AI clients use the platform RTC packages documented in Agora Convo AI Client, not this npm package.
Web only. The RTC Adapter currently targets browser apps.
When to use the RTC Adapter
The
platform-integrations/livekit-room-demo demo is the minimal LiveKit example for the RTC Adapter; it is not the full Backend Mode + RTC transport voice-agent demo. For Agora, see Agora Convo AI Client.
Install
- pnpm
- npm
- yarn
@spatius/[email protected] requires @spatius/[email protected] or newer.How it works
The RTC Adapter is a thin layer on top of@spatius/avatarkit:
- It runs on top of the underlying SDK initialized with
DrivingServiceMode.rtc, so the avatar accepts externally driven motion data. - A provider opens an RTC connection to the room. This page documents and demos
LiveKitProvider;AgoraProvideris also exported by@spatius/avatarkit-rtcwith the sameAvatarPlayersurface. - The provider publishes the local microphone track (when
startPublishing()is called) and subscribes to the remote audio track and the motion data stream published by Motion Server. - The browser plays the remote audio track through WebRTC. The RTC Adapter feeds motion data into
@spatius/avatarkitfor local rendering.
Provider abstraction
LiveKitProviderOptions
Most LiveKit integrations use the default provider constructor. If your LiveKit transport publishes the motion data track under a custom publication name, pass aLiveKitProviderOptions object.
The same
AvatarPlayer surface works across providers — code that talks to the player does not need to change when the provider swaps. Both providers are exported from the package root:
Native client access
The RTC Adapter creates and owns the low-level RTC client internally. Do not create a separate LiveKitRoom or Agora Web SDK client for avatar playback. For advanced platform features, access the owned client through getNativeClient().
AvatarPlayer method when your app plumbing only has the player instance. The value is null until the provider has a native RTC client to return.
API
For the fullAvatarPlayer API — constructor options, connect, microphone control, custom audio publishing, events, reconnect, and browser compatibility — see LiveKit Agents Integration Client. The signatures are exposed by the same package; only the integration narrative on that page differs.
AvatarPlayer also exposes sessionSummary, a read-only diagnostics snapshot for the current player lifetime. Use it to inspect cumulative RTC playback health, such as ordering, loss recovery, skipped playback, and stalled playback behavior. Treat the object shape as SDK-owned diagnostics data rather than application state.
Related guides
LiveKit Agents Client
Use the RTC Adapter with a LiveKit Agents worker.
Agora Client
Use the RTC Adapter with an Agora Convo AI graph.
Backend Mode with LiveKit
Use the RTC Adapter as the Web transport for a Backend Mode pipeline.

