Eka Care Ekascribe Typescript SDK Integration
This guide explains how to integrate the Eka Care Ekascribe Typescript SDK into your application.Overview
The Eka Care Ekascribe SDK allows you to capture and process audio, generating structured medical documentation using Eka Care’s voice transcription API.Prerequisites
Before getting started, ensure you have:- Node 14 or higher
npm
oryarn
for dependency management- Access and refresh tokens from Eka Care (optional for some methods)
- Microphone access via browser permissions
- Stable network connectivity
Installation
Install the SDK usingnpm
or yarn
:
Usage
1. Initialize Ekascribe
Before using any other method, initialize the SDK with access and refresh tokens.2. Fetch configurations list
Get supported input languages, output formats, and consultation modes.-
Response type:
3. Start recording
Start recording with user-selected options.-
Response type:
4. Pause recording
Use the method to pause voice recording-
Response type:
5. Resume recording
Use the method to resume voice recording-
Response type:
6. End recording
Use the method to end voice recording-
Response type:
7. Retry upload recording
Use this method to retry uploading failed audio files.-
Response type:
force_commit
behavior
— If force_commit
is set to true
, the SDK will call the commit API even if some audio files still fail to upload after retrying once.
— If force_commit
is set to false
, the SDK will wait until all audio files are uploaded successfully before making the commit request.
8. Cancel recording session
Use the method to cancel a recording session.-
Response type:
9. Commit transaction
Use this method to commit a transaction that is not yet committed or returned a “commit failed” error in a previous step.-
Response type:
10. Stop transaction
Use this method to stop a transaction that has not yet been stopped or returned a “stop failed” error in a previous step.-
Response type:
11. Get output template prescriptions
Use this method to fetch the final generated prescription output for a session.12. Get total uploaded files
Use this method to retrieve all the audio files generated for a specific session.-
Response type:
13. Get successfully uploaded files
Use this method to retrieve all the audio files that were uploaded successfully.-
Response type:
14. Get failed audio files
Use this method to retrieve all the audio files that failed to upload.-
Response type:
15. Generic Error Callback
Whenever an error occurs in the SDK during voice recording, the following callback will be triggered. You can listen to this to handle errors globally.ERROR CODES:
Error Code | Description |
---|---|
microphone | Microphone access error (permission denied or unavailable) |
txn_init_failed | Failed to initialize transaction |
txn_limit_exceeded | Maximum number of concurrent transactions exceeded |
unknown_error | An unknown or unclassified error occurred |
txn_stop_failed | Error occurred while stopping the transaction |
audio_upload_failed | Audio file upload to server failed |
txn_commit_failed | Commit call failed for the current transaction |
invalid_request | Request to SDK was malformed or missing required parameters |
vad_not_initialized | Voice activity detection engine was not initialized |
no_audio_capture | No audio was captured during the recording session |
txn_status_mismatch | Invalid operation due to mismatched transaction status |