SDKClientInstance
The main SDK client interface providing methods for managing encounters, ambient sessions, and events.
interface SDKClientInstance {
activeAmbientId: string | null;
attemptLogin(): Promise<true | void>;
setPartnerToken(partnerToken: string): void;
cancelAmbient(): void;
cleanup(): void;
destroy(): void;
mount(options: MountOptions): Promise<void>;
on<T extends keyof EmitterEvents>(
type: T,
handler: (data: EmitterEvents[T]) => void | Promise<void>,
): () => void;
pauseAmbient(): void;
resumeAmbient(): void;
setAmbientOptions(options: AmbientOptions): void;
setEncounter(encounter: Encounter): Promise<void>;
startAmbient(): void;
submitAmbient(): void;
}
Properties
Property | Type | Description |
---|
activeAmbientId | string | null | The ID of the currently active ambient session, or null if no session is active |
Methods
Method | Parameters | Return Type | Description |
---|
attemptLogin | - | Promise<true | void> | Re-authenticates the user with the SDK |
cancelAmbient | - | void | Cancels the current ambient session |
cleanup | - | void | Cleans up the SDK and removes all event listeners |
destroy | - | void | Destroys the SDK instance and stops token refresh |
mount | options: MountOptions | Promise<void> | Mounts the SDK to a DOM element with the specified configuration |
on | type: T, handler: Function | () => void | Subscribes to SDK events. Returns an unsubscribe function |
pauseAmbient | - | void | Pauses the current ambient session |
resumeAmbient | - | void | Resumes a paused ambient session |
setAmbientOptions | options: AmbientOptions | void | Updates the ambient session configuration |
setEncounter | encounter: Encounter | Promise<void> | Sets the encounter context |
setPartnerToken | partnerToken: string | void | Updates the partner token for authentication after token refresh |
startAmbient | - | void | Starts a new ambient session |
submitAmbient | - | void | Submits the current ambient session |
Responses are generated using AI and may contain mistakes.