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

# Technical

> Technical questions about Headless Web SDK

<Accordion title="Which commands work offline, and how are errors handled?">
  To effectively manage offline scenarios, you must understand which commands require an active network connection and which function locally.

  **Commands that require a network**

  The following commands **always require an active internet connection**. If you call them while offline, the SDK throws a `PlatformError` (or a wrapped network error).

  * **Authentication**: `login`, `registerUser`, `updatePartnerToken`.

  * **Session creation**: `session.create` (from the useAmbient hook).

  * **Initial start**: The `start` method (from `useAmbientSession`) needs a connection **once** to establish the backend session stream.

  **Commands that work offline**

  Once you successfully start a session, the Suki SDK becomes offline-resilient.

  * **Capture**: If the network drops after the session starts, the SDK continues to capture and buffer microphone audio locally in IndexedDB.

  * **Pause and resume**: Use `pause` and `resume` while offline. The SDK updates the local state immediately and reconciles it eventually when the connection returns.

  * **Submit**:

    * **Online**: The session finalizes immediately.

    * **Offline**: The SDK marks the session as "finalize-pending." It automatically starts the upload process once the network is restored.

  * **Cancel**:

    * **Online**: The session cancels immediately.

    * **Offline**: The cancellation is queued. If the session is still valid when you reconnect, the SDK applies the cancellation.

  **Error handling and status tracking**
  You should monitor the session status to handle offline behaviors correctly.

  * **Errors**: Connectivity issues during online-only commands surface as `PlatformError`. You should catch these and notify the user to check their connection.

  * **Status updates**: The outcome of offline actions (like `submit` or `cancel`) is reflected in the session status. Track this using the `useOfflineSessions` hook in React.

  <Note>
    The initial `create` and `start` commands are the only critical points that require a network. After that, the SDK safely stores encrypted audio locally and syncs your `submit` or `cancel` actions eventually.
  </Note>
</Accordion>

<Accordion title="How long does the SDK remain in offline mode?">
  Offline mode has no fixed timeout. As long as the browser's **IndexedDB** remains intact, the SDK preserves the buffered sessions.

  If you close the browser tab or window, the SDK scans the database when you re-initialize the `PlatformClient` on the next load. It then automatically starts
  uploading any offline sessions that you previously submitted. The browser's **storage settings** determine the effective lifetime of this offline data.

  <Note>
    Effective lifetime of offline data is governed by browser storage and not by an internal SDK timer.
  </Note>
</Accordion>

<Accordion title="What happens if I refresh the page while a session is recording?">
  The SDK manages session persistence internally. If an ongoing session is interrupted by a refresh or relaunch, you can resume it by passing the same `ambientSessionId`.

  The session continues from where it left off, and you can track updates via the `useOfflineSessions` hook.
</Accordion>
