ConvaiClient (Core API)

ConvaiClient is the main class for managing Convai in vanilla TypeScript.

Creating a Client

const client = new ConvaiClient();

You configure it when calling connect().


Connecting

await client.connect({
  apiKey: string,
  characterId: string,
  endUserId?: string,
  url?: string,
  enableVideo?: boolean,
  startWithVideoOn?: boolean,
  ttsEnabled?: boolean,
  actionConfig?: {
    actions: string[];
    characters: Array<{ name: string; bio: string }>;
    objects: Array<{ name: string; description: string }>;
    currentAttentionObject?: string;
  }
});

Connection Methods


Messaging


Media Controls

All controls are async.


Core Properties

Last updated

Was this helpful?