Quick Reference
AvatarSDK
Main entry point for SDK initialization and global configuration.Static Properties
Static Methods
initialize(appId, configuration)
Initialize the SDK. Must be called before any other operations.setSessionToken(token)
Set session token for authentication. Only required for SDK Mode (server-driven animation).- Only needed for SDK Mode - not required for Host Mode or RTC Mode
- Token must be obtained from your backend server
- Token has max 24 hours validity
- Token must be paired with App ID
setUserId(userId)
Set user ID for logging and analytics.cleanup()
Release all SDK resources. Call when SDK is no longer needed.AvatarManager
Handles avatar loading and caching.Static Properties
Instance Methods
load(id, onProgress?)
Load an avatar by ID.
Returns:
Promise<Avatar | null>
clearAll()
Clear all cached avatar resources.AvatarView
3D rendering view that displays the avatar.Constructor
Instance Properties
Instance Methods
dispose()
Clean up view resources. Call when view is no longer needed.AvatarController
Handles real-time communication with the avatar service.Instance Properties
Event Callbacks
Instance Methods
initializeAudioContext()
Initialize audio context. MUST be called in user gesture context.start()
Connect to the avatar service. SDK mode only.send(audioData, end)
Send audio data to server. SDK mode only.
Returns:
string - Conversation ID
close()
Close service connection. SDK mode only.Host Mode Methods
For Host Mode (DrivingServiceMode.host) only:

