[Sofia SDK] when debug="true" is enabled.
For symptom-based troubleshooting (e.g., “component doesn’t load”), see the Troubleshooting guide.
Error categories
The SDK classifies errors into seven categories, each with a dedicated logger method:Configuration errors
Missing required properties
Console output:apikey, userid, patientid) is missing or empty — or, for a key that requires it, baseurl is missing.
Resolution:
- Verify
apikey,userid, andpatientidare set on the<sofia-sdk>element - Check that values are not empty strings or
undefined - For newer keys the endpoint is auto-resolved; if your key requires
baseurl, ensure it is set and useshttps://
Missing session identifiers
Console output:userid or patientid is missing or empty.
Resolution:
- Provide both
useridandpatientidas non-empty strings - These values should uniquely identify the current doctor and patient session
Authentication errors
Invalid API key (HTTP 401)
Console output:apikey prop contains an invalid, expired, or revoked API key.
Resolution:
- Verify the API key is correct and active
- Confirm you’re using the right key for your environment (sandbox vs production)
- Check that the key hasn’t been rotated or revoked
- Contact support if the key should be valid
Incorrect base URL (HTTP 404)
Console output:baseurl prop points to a non-existent endpoint.
Resolution:
- Verify the URL matches your assigned environment
- Ensure you’re not mixing sandbox and production URLs
- Check for typos in the URL
Settings errors
Template validation failed
Console output:template prop contains invalid JSON or is missing required schema keys ($schema, type, properties).
Resolution:
- Validate your JSON syntax at jsonlint.com
- Ensure the schema includes
"$schema": "http://json-schema.org/draft-07/schema#" - Verify
"type": "object"is present - Check that
propertiescontains at least one field definition - See Template validation checklist for details
Fallback to server template
Console output:template prop couldn’t be parsed after three attempts (JSON.parse, prefix removal, Function eval). The SDK falls back to the server-configured template for your templateid.
Resolution:
- Fix the local template JSON — this is usually a syntax error
- Check for unescaped special characters in the template string
- If passing programmatically, ensure you’re passing a JSON string, not a JavaScript object
API errors
Report generation failed
Console output:- Check the specific error message for details
- Verify network connectivity to the API server
- Ensure the template schema is valid
- If the error persists, retry after a few seconds
- Contact support with the error message if the issue continues
Network errors
Console output:- Verify internet connectivity
- Check if the API endpoint is reachable
- Look for CORS errors in the browser console
- Verify firewall/proxy settings don’t block the API domain
Audio errors
Microphone access denied
Console output:- Check browser permissions — click the lock icon in the address bar
- Ensure the page is served over HTTPS (required for WebRTC)
- Verify the microphone hardware is connected and functional
- In Chrome, go to
chrome://settings/content/microphoneto check site permissions
Audio recording failure
Console output:- Try a different microphone
- Close other applications that may be using the microphone
- Test in a different browser (Chrome is recommended)
- Check the browser console for more specific WebRTC errors
WebSocket errors
Connection failure
Console output:wssurl prop is deprecated and ignored since v1.0.7).
Resolution:
- Check network connectivity and firewall rules
- Ensure WebSocket (
wss://) connections are not blocked by proxy - Confirm your
apikeyis valid so the settings API can return the transcriber URL - Verify the page is served over HTTPS
Disconnection during transcription
Console output:- Check network stability
- The SDK attempts automatic reconnection — wait for it to reconnect
- If disconnections are frequent, check your network infrastructure
- Verify no proxy or firewall is terminating idle WebSocket connections
Storage errors
LocalStorage unavailable
Console output:- Check if the browser is in private/incognito mode — some features may not persist
- Clear browser storage if it’s full
- Verify that LocalStorage is not blocked by enterprise policies or browser settings
Input validation errors
These errors occur when user input fails security validation:Input validation runs automatically on user input. These errors are security features and should not be suppressed. If legitimate medical text triggers a false positive, contact support with the specific text that was rejected.
Deprecation warnings
When using deprecated props withdebug="true", the SDK emits: