useSuki
React hook for managing SDK state and operations within React components.
UseSukiReturn
- Object containing SDK state and methods for ambient session management.
Return type of the useSuki hook containing SDK state and methods.
Property | Type | Description |
---|---|---|
activeAmbientId | string | null | The ID of the currently active ambient session, or null if no session is active |
error | SukiError | null | Current error state of the SDK, or null if no errors |
isAmbientInProgress | boolean | Whether an ambient session is currently in progress |
isAmbientPaused | boolean | Whether the current ambient session is paused |
isInitialized | boolean | Whether the SDK has been successfully initialized |
Method | Parameters | Return Type | Description |
---|---|---|---|
attemptLogin | - | void | Attempts to authenticate when SDK is not authenticated after initialization |
cancelAmbient | - | void | Cancels the current ambient session |
init | options: InitOptions | void | Initializes the SDK with the provided options |
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 |
setEncounter | encounter: Encounter | Promise<void> | Updates the current encounter data |
setPartnerToken | partnerToken: string | void | Updates the partner token after token refresh |
startAmbient | - | void | Starts a new ambient session |
submitAmbient | - | void | Submits the current ambient session |