1. Starting a Session
- Generate a session token configured for FULL mode on your backend
- Pass the token to your frontend application
- Call the start session endpoint
- Establish a WebRTC connection to the LiveAvatar-managed room
Make sure the session token has mode set to "FULL". Token configuration determines which mode initializes.
2. Managing the Session
After connecting to the room, session management is entirely event-driven. You control the session by sending and receiving events through LiveKit data channels.
Events let you:
- Track speaker state (user speaking, avatar speaking)
- Capture transcript data
- Control avatar behaviors (interrupt, idle, listening)
- Direct avatar responses and audio input processing
Recommended architecture
We recommend making your frontend the primary controller for emitting events from the LiveKit room — this minimizes latency between user interactions and avatar responses. Event data can be relayed to your backend for downstream processing, logging, and analytics.
3. Ending the Session
When the session ends:
- The LiveKit room closes
- The avatar leaves the room
- The user is removed if still present
- External resources are cleaned up
You can end a session by calling the Stop Session endpoint or by the session timing out.
Next steps
- Configuration — customize avatar, voice, context, and interactivity
- Events — full reference of command and response events