SDK state machine
Every consultation session moves through a defined set of states. Understanding these transitions helps you drive your UI — for example, showing a spinner duringINITIALIZING or a warning banner during RECONNECTING.
The possible state values are:
Listen for state changes
Subscribe to thestate-change event to receive every transition:
Built-in error handling
The SDK includes retry logic for transient errors such as network interruptions and server errors. If the connection drops while audio is streaming, the SDK enters theRECONNECTING state and continues buffering audio locally. Once the connection is re-established, all buffered audio is sent to the server — no data is lost.
If the SDK encounters a non-recoverable error, it emits an error event:
Explicit error handling
startRecording is asynchronous and may reject if the microphone is unavailable, permissions are denied, or the server cannot be reached. Wrap it in a try/catch block to handle these cases gracefully:
Report generation result
After a consultation completes, check thegeneration_result field in the summary to confirm the report was generated successfully. See the report generation result reference for the list of possible values and how to handle each one.
Log level
Log level configuration was introduced in SDK v1.8.1.
info level. You can adjust this when initializing the SDK to get more or less output: