> ## 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.

# Classes Reference

> Web SDK class definitions, constructors, and methods reference

This section provides a detailed reference for all classes available in the Suki Web SDK.

## SDKClient instance

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.

```js JavaScript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
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

<ResponseField name="activeAmbientId" type="string | null">
  The ID of the currently active ambient session, or `null` if no session is active.
</ResponseField>

### Available methods

<Expandable title="available methods" defaultOpen="true">
  <ResponseField name="attemptLogin" type="Promise<true | void>">
    Re-authenticates the user with the SDK. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="cancelAmbient" type="void">
    Cancels the current ambient session. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="cleanup" type="void">
    Cleans up the SDK and removes all event listeners. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="destroy" type="void">
    Destroys the SDK instance and stops the token refresh mechanism. This method does not take any parameters. For more information, see the [Token refresh](/web-sdk/guides/token-refresh) guide.
  </ResponseField>

  <ResponseField name="mount" type="Promise<void>">
    Mounts the SDK to a specified DOM element with the provided configuration options.

    <Expandable title="parameters" defaultOpen="true">
      <ResponseField name="options" type="MountOptions" href="/web-sdk/api-reference/types#mountoptions" required>
        The configuration options for mounting the SDK.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="on" type="() => void">
    Subscribes to SDK events. This method returns an unsubscribe function.

    <Expandable title="parameters" defaultOpen="true">
      <ResponseField name="type" type="T" required>
        The type of event to subscribe to (e.g., `'ready'`, `'ambient:update'`).
      </ResponseField>

      <ResponseField name="handler" type="(data: EmitterEvents[T]) => void | Promise<void>" required>
        The callback function to be executed when the event is emitted.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="pauseAmbient" type="void">
    Pauses the current ambient session. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="resumeAmbient" type="void">
    Resumes a paused ambient session. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="setAmbientOptions" type="void">
    Updates the ambient session configuration dynamically.

    <Expandable title="parameters" defaultOpen="true">
      <ResponseField name="options" type="AmbientOptions" href="/web-sdk/api-reference/types#ambientoptions" required>
        The new ambient session configuration options.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="setEncounter" type="Promise<void>">
    Sets the encounter context for the next ambient session. Call this before you start ambient, or after the current ambient session ends. If an ambient session is in progress, the call fails with **`SUKI0014`** (`ambient-in-progress`).

    <Expandable title="parameters" defaultOpen="true">
      <ResponseField name="encounter" type="Encounter" href="/web-sdk/api-reference/types#encounter" required>
        Full [`Encounter`](/web-sdk/api-reference/types/encounter) payload. **`patient.identifier`** is required. **`encounter.identifier`** is optional. Each value must be **at most 36 characters** (<Tooltip tip="VARCHAR is a variable-length SQL string type. varchar(36) caps these identifiers at 36 characters. See the Glossary." cta="View in Glossary" href="/Glossary/v#varchar-36">varchar(36)</Tooltip>) when present.

        <Note>
          * From Web SDK **v3.2.0**, if you set **`encounter.identifier`**, use a **UUID**. The Web SDK maps that value to **`emr_encounter_id`** for ambient interoperability and encounter note retrieval. Non-UUID values can break past-note loading even when ambient session start, pause, and submit still work. Refer to [Encounter type definition](/web-sdk/api-reference/types/encounter) for more information.
          * From Web SDK **v3.3.0**, Patient Summary uses **`encounter.identifier`** and **`encounter.practitionerFhirId`** on the headed patient profile. Pass **`practitionerFhirId`** when you initialize and when you mount. `setEncounter` can switch the encounter so the profile can load that summary. It does **not** generate again. Initialize again to generate for a different practitioner. Refer to [Patient Summary in Web SDK](/web-sdk/guides/patient-summary) for more information.
        </Note>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="setPartnerToken" type="void">
    Updates the `partnerToken` for authentication after a token refresh.

    <Expandable title="parameters" defaultOpen="true">
      <ResponseField name="partnerToken" type="string" required>
        The new `partnerToken` string.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="startAmbient" type="void">
    Starts a new ambient session. This method does not take any parameters.
  </ResponseField>

  <ResponseField name="submitAmbient" type="void">
    Submits the current ambient session for processing. This method does not take any parameters.
  </ResponseField>
</Expandable>

## Next steps

<Icon icon="file-lines" iconType="solid" /> Refer to the [Functions](/web-sdk/api-reference/functions) to learn more about the available functions in the Suki Web SDK.
