# KheelonaVoice

Source: https://docs.voice.kheelona.com/reference/sdk/classes/kheelonavoice/

The entry point of the SDK. Call [KheelonaVoice.connect](https://docs.voice.kheelona.com/reference/sdk/classes/kheelonavoice.md#connect) to start a session. The Browser SDK guide
(`/guides/browser-sdk/`) walks through it with code.

## Constructors

### Constructor

> **new KheelonaVoice**(): `KheelonaVoice`

#### Returns

`KheelonaVoice`

## Methods

### connect()

> `static` **connect**(`o`): `Promise`\<[`VoiceSession`](https://docs.voice.kheelona.com/reference/sdk/interfaces/voicesession.md)\>

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.

#### Parameters

##### o

[`ConnectOptions`](https://docs.voice.kheelona.com/reference/sdk/interfaces/connectoptions.md)

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

#### Returns

`Promise`\<[`VoiceSession`](https://docs.voice.kheelona.com/reference/sdk/interfaces/voicesession.md)\>
