Skip to content

KheelonaVoice

The entry point of the SDK. Call KheelonaVoice.connect to start a session. The Browser SDK guide (/guides/browser-sdk/) walks through it with code.

new KheelonaVoice(): KheelonaVoice

KheelonaVoice

static connect(o): Promise<VoiceSession>

Connects a session. Call it from a user gesture (a click): the audio context and the microphone start here. Rejects with a KheelonaVoiceError. After a failed connect(), create a new session (a new client secret) before trying again: the secret may be spent or expired. The exception is capacity_exhausted with retryAfterMs: retry the same secret after that wait while it is under 60 s old. A busy-server answer with a wait of 2 s or less (one server at its session limit) is retried here, up to 3 times, before connect() rejects. error.cause may hold the browser’s own exception, whose text can quote SDP lines (ephemeral ICE credentials): don’t log it verbatim.

ConnectOptions

The session id and client secret from your server, and optional settings.

Promise<VoiceSession>