ambient:update event includes an ambientSessionId. That is the unique ID for that recording session.
Use it to follow the session lifecycle and when you report issues to support. You can also read the current session ID from activeAmbientId on SDKClientInstance or from useSuki() after you call startAmbient(). Refer to Create session for more detail.
Quick reference: IDs
The diagram below shows the order of IDs generated in the different stages of the ambient session lifecycle while using the Web SDK. You start with the encounter ID, which is the encounter you supplied at setup. Next is the note ID, which identifies the note generated after the session is submitted. Then comes the ambient session ID, which is created when you callstartAmbient(). Finally, the active ambient ID identifies the session that is currently active.
| Field | Where you read it | What it is |
|---|---|---|
encounterId | onNoteSubmit (React) and note-submission:success when the note completes successfully | Unique identifier for the encounter associated with the note. Refer to Note management. |
noteId | onNoteSubmit (React) and note-submission:success when the note completes successfully | Unique identifier for the generated note. Refer to Note management. |
ambientSessionId | ambient:update (along with isAmbientInProgress and isAmbientPaused), and in payloads for the ambient:start, ambient:pause, ambient:resume, ambient:cancel, and ambient:submit events | Unique ID for a recording session. This is the same session identifier emitted across ambient events. Refer to Emitter events for the exact payload types. |
activeAmbientId | SDKClientInstance, useSuki() | The ID of the currently active ambient session. Returns null if no session is active (Classes, Hooks). |
Important:
encounterId is not the same as ambientSessionId or activeAmbientId. It comes back after the note completes (refer to Note management). It is the encounter you supplied at setup.Lifecycle events
The Web SDK emits these events when the session state changes:ambient:start- Emitted when a new ambient session is started.ambient:pause- Emitted when the ambient session is paused.ambient:resume- Emitted when the ambient session is resumed.ambient:cancel- Emitted when the ambient session is cancelled.ambient:submit- Emitted when the ambient session is submitted.
Status flags
Returns
true if an ambient session is currently active (started and not cancelled or submitted).Returns
true if the ambient session is currently in a paused state.