Advanced configurations
Wrap your application with SukiProvider
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.
Initialize the SDK inside SukiProvider
Before you can use advanced features, you must initialize the SDK inside theSukiProvider context.
Use SukiAuthManager from @suki-sdk/core for partnerToken and provider fields, then call init from useSuki once when your application loads (typically inside a useEffect), passing authManager on the options object. See Migrating to Web SDK v3.
Configure the SukiAssistant component
The<SukiAssistant /> component is the main UI for the SDK. 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.
Configure 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.Array
An array of objects that defines the clinical sections for note generation, identified by LOINC codes.
object
Optional. Use this when you have Problem-Based Charting (PBC) enabled. Pass the patient’s existing diagnoses (e.g. from the EMR) so the session can merge them with what’s discussed during the visit and avoid duplicate problems in the note.Each item in
values is one diagnosis: give it a single code (ICD10 only for now) and optionally a description or diagnosis_note. Refer to the Existing patient diagnoses guide for more details.UI Prop
UI Prop
uiOptions: Controls the visibility and functionality of UI elements like the close button or editing features within note sections.boolean
Controls visibility of the close button in the header.
boolean
Controls visibility of the create empty note button in the patient profile.
boolean
Controls visibility of the start ambient button in the patient profile.
object
Controls the visibility and functionality of editing features within note sections.
Configure Event handlers
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.