Documentation Index Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This section provides a detailed reference for all React hooks available in the Suki Web SDK.
useSuki hook
The useSuki hook is a React hook for managing SDK state and operations within React components.
The code snippet below shows how to use the useSuki hook to access SDK state and methods:
const client : UseSukiReturn = useSuki () ;
Returns
It returns a UseSukiReturn object containing SDK state and methods for ambient session management.
UseSukiReturn type
Return type of the useSuki hook containing SDK state and methods.
type UseSukiReturn = {
activeAmbientId : string | null ;
attemptLogin : () => void ;
cancelAmbient : () => void ;
error : SukiError | null ;
init : ( options : ReactInitOptions ) => void ;
isAmbientInProgress : boolean ;
isAmbientPaused : boolean ;
isInitialized : boolean ;
on : < T extends keyof EmitterEvents > (
type : T ,
handler : ( args : EmitterEvents [ T ] ) => void | Promise < void >,
) => () => void ;
pauseAmbient : () => void ;
resumeAmbient : () => void ;
setEncounter : ( encounter : Encounter ) => Promise < void >;
setPartnerToken : ( partnerToken : string ) => void ;
startAmbient : () => void ;
submitAmbient : () => void ;
};
Available properties
The ID of the currently active ambient session, or null if no session is active.
Current error state of the SDK, or null if no errors.
Whether an ambient session is currently in progress.
Whether the current ambient session is paused.
Whether the SDK has been successfully initialized.
Available methods
Attempts to authenticate when SDK is not authenticated after initialization. This method does not take any parameters.
Cancels the current ambient session. This method does not take any parameters.
Initializes the SDK with the provided options. Web SDK v3 passes authManager from @suki-sdk/core on options instead of partner fields alone. See Migrating to Web SDK v3 . The configuration options required to initialize the SDK.
Subscribes to SDK events. This method returns an unsubscribe function. The type of event to subscribe to (e.g., 'ready', 'ambient:update').
handler
(args: EmitterEvents[T]) => void | Promise<void>
required
The callback function to be executed when the event is emitted.
Pauses the current ambient session. This method does not take any parameters.
Resumes a paused ambient session. This method does not take any parameters.
Updates the current encounter data. The encounter object containing updated patient and encounter details.
Updates the partner token after token refresh. The new partner token string.
Starts a new ambient session. This method does not take any parameters.
Submits the current ambient session. This method does not take any parameters.
Next steps
Refer to the Provider types to learn more about the provider types.