Skip to main content

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

SukiError type represents the structure for SDK errors. The code snippet below shows how to use the SukiError type to create a suki error object.
JavaScript
type SukiError = {
  code: ErrorCode;
  details: ErrorDetail;
};

Properties

ErrorCode identifier

ErrorCode represents the unique identifiers for different types of SDK errors. The following table lists the available error code identifiers and their descriptions.
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

ErrorDetail represents the detailed information about a specific error. The code snippet below shows how to use the ErrorDetail type to create an error detail object.
JavaScript
type ErrorDetail = {
  name: `init:sdk-init-failed` | `init:auth-failed` ...;
  message: string;
  reason?: ErrorReasons;
}

ErrorDetail properties

ErrorReasons

ErrorReasons represents the specific reasons that provide additional context for why an error occurred.
JavaScript
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";
The below table lists the available error reasons and their descriptions.
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

Example

JavaScript
const error = {
  code: "SUKI0001",
  details: {
    name: "init:sdk-init-failed",
    message: "SDK initialization failed",
    reason: "lib-error"
  }
};
Last modified on April 1, 2026