Skip to main content
We recommend the SDK approach as it simplifies implementation by handling voice activity detection (VAD), audio chunking, uploads, and other complexities, making it easy to plug into your existing workflow.

Step 1: Get Your API Credentials

You need a client_id and client_secret to authenticate with EkaScribe.
1

Create an Eka Account

Sign up on Eka if you haven’t already.
2

Generate API Credentials

Go to the Eka Developer Console, navigate to Manage API Credentials, and create a new client.
3

Save Your Credentials

Copy your client_id and client_secret. Store them securely, the secret won’t be shown again.
You can create a long live token against your client ID, which you can directly pass as an access token.
4

Get Access Token

Use the Client Login API to obtain an access token, or use your long live token.
View detailed authentication guide →

Step 2: Install the SDK

We recommend the TypeScript SDK for the fastest plug-and-play integration.
npm install @eka-care/ekascribe-ts-sdk
# or
yarn add @eka-care/ekascribe-ts-sdk

Step 3: Start Transcribing

Here’s a complete working example to record a consultation and get structured medical notes:
import { getEkaScribeInstance } from '@eka-care/ekascribe-ts-sdk';

// 1. Get the SDK instance. `allianceConfig.baseUrl` is required.
const ekascribe = getEkaScribeInstance({
  access_token: '<your_access_token>',
  env: 'PROD', // 'PROD' | 'DEV'
  allianceConfig: {
    baseUrl: 'https://api.eka.care/voice/v1', // PROD (use https://api.dev.eka.care/voice/v1 for dev)
  },
});

// 2. Register callbacks before recording (errors, token refresh, upload progress)
ekascribe.registerCallback('onError', (event) => {
  console.error(`[${event.error.code}] ${event.error.message}`);
});
ekascribe.registerCallback('onTokenRequired', async () => {
  return await refreshMyAuthToken(); // return the new token string
});

// 3. Start recording - creates a session, requests mic permission, and begins chunked upload
const result = await ekascribe.startRecordingV2({
  templates: ['clinical_notes_template'], // required: template IDs for extraction (from getConfig → my_templates)
  languageHint: ['auto_detect'],          // required: input audio language hints. If you're not offering users a language change option in your UI, use ['auto_detect'] for the best results.
  sessionMode: 'consultation',            // required: 'consultation' | 'dictation'
  model: 'pro',                           // required: 'pro' | 'lite'
  uploadType: 'chunked',                  // optional: 'chunked' (default) | 'single'
});

if (result.error_code) {
  console.error(result.error_code, result.message);
}
const sessionId = result.txn_id!;

// ... consultation happens ...

// 4. Pause / resume recording at any time (optional)
ekascribe.pauseRecording();  // pauses VAD - mic stays open, no new chunks created
ekascribe.resumeRecording(); // resumes VAD processing

// 5. Stop recording - SDK flushes the last chunk, waits for uploads & ends the session
const endResult = await ekascribe.endRecording();
if (endResult.error_code === 'audio_upload_failed') {
  await ekascribe.retryUploadRecording(); // retry the failed chunks
}

// 6. Poll for the structured output until processing completes
const status = await ekascribe.getSessionStatus(sessionId, {
  poll: { maxAttempts: 60, intervalMs: 2000 },
});

if (status.success) {
  console.log('Templates:', status.data.templates);
  console.log('Transcript:', status.data.transcript);
}
That’s it. The SDK handles VAD, audio chunking, file uploads, retries, and polling - you just call the methods.
Production APIs require a secure (HTTPS) origin and won’t work from http://localhost. Use ngrok to tunnel over HTTPS, or point at the development baseUrl (https://api.dev.eka.care/voice/v1) which works from plain localhost.
For the full method reference, callbacks, widget, and session utilities, see the TypeScript SDK guide.

Explore Other Integration Options

You can also integrate EkaScribe using other SDKs, REST APIs, or the Chrome Extension.