Skip to main content

FAQs

To effectively manage offline scenarios, you must understand which commands require an active network connection and which function locally.Commands That Require a NetworkThe 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 OfflineOnce 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: You can 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 finalize 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. You can track this using the useOfflineSessions hook in React.
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.
There is no fixed timeout for offline mode. 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.
Effective lifetime of offline data is governed by browser storage and not by an internal SDK timer.
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.