useConvaiClient Hook
useConvaiClient manages all Convai connection logic, audio/video pipelines, and message flows.
Configuration
interface ConvaiConfig {
apiKey: string; // Required: Your API key
characterId: string; // Required: Character ID
endUserId?: string; // Optional: For memory & analytics
url?: string; // Optional: Custom API endpoint
enableVideo?: boolean; // Enable video/screenshare (default: false)
startWithVideoOn?: boolean; // Start with camera on (default: false)
startWithAudioOn?: boolean; // Start with mic on (default: false)
ttsEnabled?: boolean; // Enable TTS (default: true)
enableLipsync?: boolean; // Enable blendshapes (default: false)
blendshapeConfig?: {
format?: 'arkit' | 'mha'; // Blendshape format (default: 'mha')
};
actionConfig?: { // Optional: Character actions
actions: string[];
characters: Array<{ name: string; bio: string }>;
objects: Array<{ name: string; description: string }>;
currentAttentionObject?: string;
};
}
Return Value
State
Connection Methods
Messaging
Controls
Example: Manual Connect
Last updated
Was this helpful?