Skip to main content
The client receives each response turn from your backend and renders it locally with AvatarKit. It never connects to Motion Server or holds a Spatius API Key.

Implement the client

1

Initialize AvatarKit in Backend Mode

Use the same App ID, Avatar ID, region, and audio format as the backend session. Backend Mode does not use a Spatius Session Token on the client.
2

Connect to your backend

Use your application’s WebSocket or streaming transport. For every response, deliver the audio before its first motion data payload, and include the same turn ID on both message types.
3

Feed audio and motion data

Pass each audio payload to the platform’s audio-yield method. Store the conversation ID it returns against your backend turn ID, then use that conversation ID when you pass the matching motion data to AvatarKit.
4

Clean up

Interrupt discarded turns, close your application transport, and dispose of the Avatar view when the experience ends. Do not call the Direct Mode start() or send() methods on this path.
Exact Backend Mode method names are in the Web, iOS, Android, and Flutter references.

Next steps

Complete Backend Mode demo

Client SDK references