Overview
You can customize the Suki Assistant Web SDK to fit your application’s specific needs. This example covers the complete setup, including the root provider, dynamic props, UI customization, and event handling, as shown in the comprehensive example.Configurations
Warpping Your Application
Wrapping your application with theSukiProvider component is the first step in configuring the Suki Assistant Web SDK. This is necessary for the SDK and its hooks to function correctly.
Initializing The SDK
Before you can use advanced features, you must initialize the SDK. This is done within theSukiProvider context.
Once inside the provider, you can use the useSuki hook to get the init function. You should call this function once when your application loads, typically inside a useEffect hook.
Configure The SukiAssistant Component
The<SukiAssistant /> component is the main UI for the SDK. You can configure its behavior and appearance by passing it the following props.
Handling Dynamic Encounters
Theencounter prop is the most important piece of contextual information.
The example below demonstrates how to dynamically change this prop to load different patient encounters into the SDK.
Ambient And UI Options
TheambientOptions and uiOptions props are used to configure the ambient session and the user interface of the SDK.
Ambient Prop
Ambient Prop
ambientOptions: Configures the note-generation session.An array of objects that defines the clinical sections for note generation, identified by LOINC codes.
UI Prop
UI Prop
uiOptions: Controls the visibility and functionality of UI elements like the close button or editing features within note sections.Controls visibility of the close button in the header.
Controls visibility of the create empty note button in the patient profile.
Controls visibility of the start ambient button in the patient profile.
Controls the visibility and functionality of editing features within note sections.
Event Handlers
You can listen for key events from the SDK by providingcallback functions as props. This allows your application to react when a user takes an action.
-
onNoteSubmit: This function is called when a note is successfully generated and submitted. It receives an object containing thenoteIdand thecontentsof the note. -
onClose: This function is called when the user clicks the close button in the UI.
Complete Example
This example ties all the concepts together, showing theSukiProvider, SukiAssistant, useSuki hook, dynamic encounters, and all configuration props in a single, working component structure.