Documentation Index
Fetch the complete documentation index at: https://docs.spatius.ai/llms.txt
Use this file to discover all available pages before exploring further.
@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 frames into @spatius/avatarkit.
What it is
| Package | Role |
|---|---|
@spatius/avatarkit | Web avatar rendering SDK. |
@spatius/avatarkit-rtc | Web transport adapter for RTC rooms. Depends on @spatius/avatarkit. |
Web only. The RTC Adapter currently targets browser apps.
When to use the RTC Adapter
| Scenario | Use RTC Adapter? |
|---|---|
| Direct Mode | No. Use @spatius/avatarkit directly. |
| Backend Mode with your own WebSocket | Usually no. Your client manually calls yieldAudioData() / yieldFramesData(). |
| Backend Mode with LiveKit / future Agora transport | Yes. The Web client uses the RTC Adapter. |
| LiveKit Agents Integration | Yes. The Web client uses the RTC Adapter with LiveKitProvider. |
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. Future provider examples (e.g. Agora) would sit as siblings under platform-integrations/ (e.g. platform-integrations/agora-room/).
Install
- pnpm
- npm
- yarn
How it works
The RTC Adapter is a thin layer on top of@spatius/avatarkit:
- It initializes the underlying SDK with
DrivingServiceMode.hostso 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 frames into
@spatius/avatarkitfor local rendering.
Provider abstraction
| Provider | Status |
|---|---|
LiveKitProvider | Documented here. Demoed in platform-integrations/livekit-room-demo. |
AgoraProvider | Exported by @spatius/avatarkit-rtc. Not documented or demoed in this repo yet — API surface mirrors LiveKitProvider. |
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:
API
For the fullAvatarPlayer API — constructor options, connect, microphone control, custom audio publishing, events, reconnect, native client access, and browser compatibility — see LiveKit Agents Integration Client. The signatures are exposed by the same package; only the integration narrative on that page differs.
Related guides
LiveKit Agents Client
Use the RTC Adapter with a LiveKit Agents worker.
Backend Mode with LiveKit
Use the RTC Adapter as the Web transport for a Backend Mode pipeline.