Encounter

Represents a clinical encounter with patient information.

type Encounter = {
  identifier?: string;
  patient: Patient;
};
PropertyTypeRequiredDescription
identifierstring-Unique identifier for the encounter
patientPatientPatient information for the encounter

Patient

Patient demographic and identification information.

type Patient = {
  identifier: string;
  kind?: string;
  name: {
    use: string;
    family: string;
    given: string[];
    suffix: string[];
  };
  birthDate: string;
  gender: "MALE" | "FEMALE" | "UNKNOWN";
};
PropertyTypeRequiredDescription
birthDatestringDate of birth in YYYY-MM-DD format
gender"MALE" | "FEMALE" | "UNKNOWN"Patient’s gender. Use “UNKNOWN” if gender information is not available
identifierstringUnique identifier for the patient
kindstring-Kind of patient (e.g., “human”, “animal”)
nameobjectPatient name information
name.familystringFamily name (last name)
name.givenstring[]Given names (first names)
name.suffixstring[]Name suffixes
name.usestringUse of the name (e.g., “usual”, “official”, “nickname”)

InitOptions

Configuration options for initializing the SDK.

type InitOptions = PartnerDetails & {
  enableDebug?: boolean;
  logLevel?: LogLevel;
  isTestMode?: boolean;
  theme?: ThemeOptions;
};
PropertyTypeDefaultDescription
enableDebugbooleanfalseWhether to enable debug mode. This will log additional information to the console
logLevelLogLevel-The log level to use when debug mode is enabled. Controls which messages are output to the console
isTestModebooleanfalseWhether to connect to stage environment. This will use stage endpoints
themeThemeOptions-The theme configuration for the SDK

Extends: PartnerDetails

PartnerDetails

Partner authentication and provider information required for SDK initialization.

type PartnerDetails = {
  partnerId: string;
  partnerToken: string;
  providerName: string;
  providerOrgId: string;
  providerSpecialty?: string;
  providerId?: string;
};
PropertyTypeRequiredDescription
partnerIdstringThe unique identifier of the partner to use when authenticating with the Suki Platform
partnerTokenstringThe idToken of the user/provider to use when authenticating with the Suki Platform
providerNamestringThe full name of the user/provider. First name, middle name and last name separated by a space
providerOrgIdstringThe unique identifier of the organization in the partner system to which the provider belongs
providerSpecialtystring-The specialty of the provider, if applicable. Defaults to FAMILY_MEDICINE
providerIdstring-The unique identifier of the provider in the partner system

ThemeOptions

Theme configuration options for customizing the SDK appearance.

type ThemeOptions = {
  primary?: string;
  background?: string;
  secondaryBackground?: string;
  foreground?: string;
  warning?: string;
};
PropertyTypeDefaultDescription
primarystringrgb(46, 98, 98)The primary color of the theme in rgb
backgroundstringrgb(255, 255, 255)The primary background color of the theme in rgb
secondaryBackgroundstringrgb(233, 233, 240)The secondary background color of the theme in rgb
foregroundstringrgb(0, 0, 0)The foreground/text color of the theme in rgb
warningstringrgb(255, 184, 0)The warning color used for alerts and notifications in rgb

MountOptions

Configuration options for mounting the SDK to a DOM element.

type MountOptions = {
  rootElement: HTMLElement;
  encounter: Encounter;
  uiOptions?: UIOptions;
  ambientOptions?: AmbientOptions;
};
PropertyTypeRequiredDescription
ambientOptionsAmbientOptions-Ambient session configuration options
encounterEncounterThe encounter data to pre-populate the SDK
rootElementHTMLElementThe DOM element to mount the SDK into. Should be an empty container element
uiOptionsUIOptions-UI configuration options

UIOptions

User interface configuration options for the SDK.

type UIOptions = {
  showCloseButton?: boolean;
  showCreateEmptyNoteButton?: boolean;
  sectionEditing?: SectionEditingOptions;
  showStartAmbientButton?: boolean;
};
PropertyTypeRequiredDefaultDescription
sectionEditingSectionEditingOptions-all enabledConfiguration for section editing features
showCloseButtonboolean--Whether to show the close button in the SDK header
showCreateEmptyNoteButtonboolean--Whether to show the create empty note button in the patient profile
showStartAmbientButtonboolean--Whether to show the start ambient button in the patient profile

SectionEditingOptions

Configuration for section editing features within the SDK.

type SectionEditingOptions = {
  enableDictation?: boolean;
  enableCopy?: boolean;
};
PropertyTypeRequiredDefaultDescription
enableCopyboolean-trueWhether to enable copying the section contents
enableDictationboolean-trueWhether to enable dictation feature for the sections

AmbientOptions

Configuration options for ambient session functionality.

type AmbientOptions = {
  prefill?: {
    noteTypeIds?: string[];
  };
  sections?: Section[];
};
PropertyTypeRequiredDescription
prefillobject-Prefill configuration for ambient sessions
prefill.noteTypeIdsstring[]-List of note type IDs to prefill when starting an ambient session
sectionsSection[]-Array of clinical note sections to generate suggestions for

Section

Defines a clinical note section using LOINC codes for ambient sessions.

type Section = {
  loinc: string;
  isPBNSection?: boolean;
};
PropertyTypeRequiredDescription
isPBNSectionboolean-Marks this section as the single PBN (Problem-Based Note) section. Only one section may be marked as PBN. If omitted on all sections, Assessment & Plan (LOINC 51847-2) will be used as default
loincstringStandard LOINC code identifying the section type

LogLevel

Available log levels for controlling debug output verbosity.

type LogLevel = "debug" | "info" | "warn" | "error" | "log";
  • debug - Log all messages including detailed debug information
  • warn - Log warnings and above (warn, error, log)
  • info - Log informational messages and above (info, warn, error, log)
  • error - Log errors and above (error, log)
  • log - Log only explicit log messages

The logger respects both the enableDebug flag and logLevel setting. Messages are only output when debug mode is enabled AND the message level meets or exceeds the configured log level.

EmitterEvents

Events that can be emitted by the SDK for monitoring session state and handling responses.

type EmitterEvents = {
  ready: never;
  "init:change": boolean;
  close: never;
  "ambient:update": {
    ambientId: string;
    isAmbientInProgress: boolean;
    isAmbientPaused: boolean;
  };
  "note-submission:success": {
    noteId: string;
    contents: Array<{ title: string; content: NoteContent }>;
  };
  error: SukiError;
};
EventData TypeDescription
ambient:updateobjectEmitted when ambient session state changes
close-Emitted when the SDK is closed
errorSukiErrorEmitted when an error occurs
init:changebooleanEmitted when initialization state changes
note-submission:successobjectEmitted when a note is successfully submitted
ready-Emitted when the SDK is ready for use

NoteContent

The content structure for clinical notes, including optional diagnosis and LOINC code.

type NoteContent = {
  title: string;
  content: string;
  diagnosis?: Diagnosis;
  loinc_code?: string;
};
PropertyTypeDescription
titlestringThe title of the section
contentstringContent of the section in plain text
diagnosisDiagnosisArray of clinical note sections to generate suggestions for
loinc_codestringLOINC code of the section

Diagnosis

The structure for clinical diagnosis information, including ICD and SNOMED codes.

type Diagnosis = {
  icdCode: string;
  icdDescription: string;
  snomedCode: string;
  snomedDescription: string;
  hccCode: string;
  panelRanking: number;
  billable: boolean;
  problemLabel: string;
  suggestionType: "DEFAULT" | "ED" | "PL";
};
PropertyTypeDescription
icdCodestringThe ICD code for the diagnosis
icdDescriptionstringThe description of the ICD code
snomedCodestringThe SNOMED code for the diagnosis
snomedDescriptionstringThe description of the SNOMED code
hccCodestringThe HCC code for the diagnosis
panelRankingnumberThe ranking of the diagnosis in the panel
billablebooleanWhether the diagnosis is billable
problemLabelstringThe label for the problem associated with the diagnosis
suggestionType"DEFAULT", "ED", "PL"The type of suggestion

SukiError

Error object structure for SDK errors.

type SukiError = {
  code: ErrorCode;
  details: ErrorDetail;
};
PropertyTypeDescription
codeErrorCodeUnique error code identifier
detailsErrorDetailDetailed error information including name, message, and reason

ErrorCode

Unique identifiers for different types of SDK errors.

CodeNameCategoryDescription
SUKI0001init:sdk-init-failedInitializationSDK initialization failed
SUKI0002init:auth-failedAuthenticationUser authentication failed
SUKI0003init:mount-failedInitializationSDK mounting to DOM failed
SUKI0004init:messenger-failedInitializationInternal messaging system failed
SUKI0005init:invalid-optionsInitializationInvalid initialization options provided
SUKI0006navigate:failedNavigationNavigation within SDK failed
SUKI0007create-appointment:failedEncounterFailed to create appointment/encounter
SUKI0008get-appointment:failedEncounterFailed to retrieve appointment/encounter
SUKI0009create-patient:failedPatientFailed to create patient record
SUKI0010update-patient:failedPatientFailed to update patient information
SUKI0011get-patient:failedPatientFailed to retrieve patient information
SUKI0012note-submission:failedNotesFailed to submit clinical note
SUKI0013ambient-failAmbientAmbient session operation failed
SUKI0014encounter-failEncounterGeneral encounter operation failed
SUKI0015token-update-failAuthenticationFailed to update partner token
SUKI0016unsupported-loinc-codesConfigurationProvided LOINC codes are not supported
SUKI0017no-supported-loinc-codesConfigurationNo supported LOINC codes found in configuration
SUKI0018multiple-pbn-sectionsConfigurationMultiple sections marked as PBN (Problem-Based Note)

ErrorDetail

Detailed information about a specific error.

type ErrorDetail = {
  name: `init:sdk-init-failed` | `init:auth-failed` ...;
  message: string;
  reason?: ErrorReasons;
}
PropertyTypeRequiredDescription
messagestringHuman-readable description of the error
namestringUnique name for the error (corresponds to error code)
reasonErrorReasons-Additional context about why the error occurred

ErrorReasons

Specific reasons that provide additional context for why an error occurred.

type ErrorReasons =
  | "lib-error"
  | "no-init"
  | "no-partner-token"
  | "missing-partner-details"
  | "no-init-or-auth"
  | "service-error"
  | "already-started"
  | "no-ambient"
  | "ambient-in-progress"
  | "invalid-encounter"
  | "unsupported-loinc-codes"
  | "no-supported-loinc-codes"
  | "multiple-pbn-sections";
ReasonCategoryDescription
already-startedStateOperation attempted when already in progress
ambient-in-progressAmbientCannot perform action while ambient session is active
invalid-encounterDataProvided encounter data is invalid or malformed
lib-errorSystemInternal library or system error
missing-partner-detailsConfigurationRequired partner authentication details are missing
multiple-pbn-sectionsConfigurationMultiple sections marked as PBN when only one is allowed
no-ambientStateNo ambient session available for operation
no-initStateSDK not initialized before operation attempted
no-init-or-authAuthenticationSDK not initialized or user not authenticated
no-partner-tokenAuthenticationPartner token is missing or invalid
no-supported-loinc-codesConfigurationNo supported LOINC codes found
service-errorNetworkExternal service or API error
unsupported-loinc-codesConfigurationProvided LOINC codes are not supported