Overview
This section provides a detailed reference for all classes available in the Suki Web SDK.
SDKClientInstance
The SDKClientInstance is the primary interface for interacting with the Suki Web SDK, providing comprehensive methods for managing encounters, ambient sessions, and event subscriptions.
The code snippet below shows how to use the SDKClientInstance class to interact with the Suki Web SDK.
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
The ID of the currently active ambient session, or null if no session is active.
Available Methods
Re-authenticates the user with the SDK. This method does not take any parameters.
Cancels the current ambient session. This method does not take any parameters.
Cleans up the SDK and removes all event listeners. This method does not take any parameters.
Destroys the SDK instance and stops the token refresh mechanism. This method does not take any parameters. For more information, see the Token Refresh guide. Mounts the SDK to a specified DOM element with the provided configuration options. The configuration options for mounting 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
(data: 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 ambient session configuration dynamically. The new ambient session configuration options.
Sets the encounter context for the ambient session. The encounter object containing patient and encounter details.
Updates the partner token for authentication after a token refresh. The new partner token string.
Starts a new ambient session. This method does not take any parameters.
Submits the current ambient session for processing. This method does not take any parameters.
Next Steps
Refer to the Functions to learn more about the available functions in the Suki Web SDK.