Skip to main content
Web Only: RTC Mode is currently available for Web applications only.
Do not call initializeAudioContext() — it is not needed in RTC Mode. Avatar audio is delivered as a native WebRTC audio track by the LiveKit client SDK, not through the AvatarKit SDK’s internal audio player. The AvatarPlayer adapter only feeds animation data to the SDK for rendering; audio playback is handled entirely by LiveKit’s WebRTC stack.

Installation

Critical: We are only compatable with livekit-client under version 2.17, since 2.17 introduced single PC by default. We are working on adding support for 2.17+ in a future release, but for now please ensure you install version 2.16.1 to avoid compatibility issues.
You also need to configure your build tool for WASM files — see Build Tool Configuration.

Authentication

Quick Start

For a complete client + server implementation, see AvatarKit Voice Agent Demo.
1

Initialize SDK in Host Mode

2

Load Avatar & Create View

3

Create Player with LiveKit Provider

4

Connect to LiveKit Server

5

Start Voice Interaction

AvatarPlayer API

Constructor

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.
Stall recovery example:

Complete Example

Browser Compatibility