Installation
Download the latest AvatarKit.xcframework, unzip, and drag it into your Xcode project. Set Embed & Sign in your target’s Frameworks, Libraries, and Embedded Content.AvatarSDK
Main initialization and configuration interface for AvatarKit.Type Properties
appID
appID
configuration
configuration
sessionToken
sessionToken
userID
userID
isDeviceSupported()
isDeviceSupported()
version
version
Type Methods
initialize(appID:configuration:)
initialize(appID:configuration:)
appID: The app identifierconfiguration: The configuration for AvatarKit
deviceScore()
deviceScore()
DeviceScore containing cpuScore: Int and gpuScore: Int.AvatarManager
Manage avatar asset loading, caching, and retrieval.Type Properties
Instance Methods
load(id:onProgress:)
load(id:onProgress:)
id: The avatar identifieronProgress: Optional progress callback
Avatar instance.cancelLoading(id:)
cancelLoading(id:)
id: The avatar identifier
cancelAllLoading()
cancelAllLoading()
retrieve(id:)
retrieve(id:)
id: The avatar identifier
Avatar if available, otherwise nil.derive(assetPath:)
derive(assetPath:)
assetPath: The path to the avatar asset
Avatar instance.clear(id:)
clear(id:)
id: The avatar identifier to clear
clearAll()
clearAll()
clearLRU(keepCount:)
clearLRU(keepCount:)
keepCount: Number of most recently used avatars to keep
getCacheSize(id:)
getCacheSize(id:)
id: The avatar identifier
getAllCacheSize()
getAllCacheSize()
AvatarController
The main controller for managing avatar driving service connections and interactions.Instance Properties
onFirstRendering
onFirstRendering
onConnectionState
onConnectionState
onConversationState
onConversationState
onError
onError
start()
start()
close()
close()
pause()
pause()
resume()
resume()
isRendering
isRendering
interrupt()
interrupt()
send(_:end:)
send(_:end:)
data: PCM16 (S16LE) mono audio data. Byte length must be even (2 bytes per sample).end: Whether this is the end of the audio stream
yield(_:end:audioFormat:)
yield(_:end:audioFormat:)
data: The audio dataend: Whether this is the end of the audio streamaudioFormat: The audio format (optional)
yield(_:conversationID:)
yield(_:conversationID:)
animations: Array of animation dataconversationID: The conversation identifier
pointCount
pointCount
volume
volume
AvatarView
A UIView subclass for rendering avatars.Initializers
init(avatar:)
init(avatar:)
avatar: The avatar to display
Instance Properties
controller
controller
avatarTransform
avatarTransform
isOpaque
isOpaque
Instance Methods
pauseRendering()
pauseRendering()
resumeRendering()
resumeRendering()
Avatar
Represents an avatar instance.Configuration
Configuration for AvatarKit.Initializers
init(environment:audioFormat:drivingServiceMode:logLevel:)
init(environment:audioFormat:drivingServiceMode:logLevel:)
environment: The environment to useaudioFormat: The audio format configurationdrivingServiceMode: The driving service modelogLevel: The log level
Environment
Environments for AvatarKit.AudioFormat
Audio format configuration for AvatarKit.Initializers
init(sampleRate:)
init(sampleRate:)
sampleRate: The audio sample rate in Hz
DrivingServiceMode
Driving service modes for AvatarKit.LogLevel
Log levels for AvatarKit.ConnectionState
Connection states for AvatarKit.ConversationState
Conversation states for AvatarKit.Transform
Transform for avatar content rendering.Initializers
init(x:y:scale:)
init(x:y:scale:)
x: The x-axis translationy: The y-axis translationscale: The scale factor

