Skip to main content
The Web SDK emits events to track ambient session status in real-time. The ambient:update event includes an ambientId field, which is the unique identifier for the session. Use this ID to track the session lifecycle. For details, see emitter events types.

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.
JavaScript
sdkClient.on("ambient:update", (flags) => {
  console.log("Ambient in progress:", flags.isAmbientInProgress);
  console.log("Ambient paused:", flags.isAmbientPaused);
});
// lifecycle events supported by the Web SDK
sdkClient.on("ambient:start", (ambientSessionId) => {  // New in v2.0.4
console.log("Ambient started:", ambientSessionId);
});

Status flags

isAmbientInProgress
boolean
Returns true if an ambient session is currently active (started and not cancelled or submitted).
isAmbientPaused
boolean
Returns true if the ambient session is currently in a paused state.

Next steps

Last modified on March 23, 2026