> ## Documentation Index
> Fetch the complete documentation index at: https://developer.eka.care/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> A step by step guide to integrate EkaScribe into your application in just few minutes

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.

<Steps>
  <Step title="Create an Eka Account">
    <a href="https://login.eka.care/workspace/sign-in/?next=https://console.eka.care&product_type=emr&signup=user_only&tab=sign-up" target="_blank">Sign up on Eka</a> if you haven't already.
  </Step>

  <Step title="Generate API Credentials">
    Go to the <a href="https://console.eka.care" target="_blank">Eka Developer Console</a>, navigate to **Manage API Credentials**, and create a new client.
  </Step>

  <Step title="Save Your Credentials">
    Copy your `client_id` and `client_secret`. Store them securely, the secret won't be shown again.
    <Tip>You can create a long live token against your client ID, which you can directly pass as an access token.</Tip>
  </Step>

  <Step title="Get Access Token">
    Use the [Client Login API](/api-reference/authorization/client-login) to obtain an access token, or use your long live token.
  </Step>
</Steps>

**[View detailed authentication guide →](/api-reference/authorization/getting-started)**

***

## Step 2: Install the SDK

We recommend the **TypeScript SDK** for the fastest plug-and-play integration.

```bash theme={null}
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:

```ts theme={null}
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.

<Warning>
  Production APIs require a secure (HTTPS) origin and won't work from `http://localhost`. Use [ngrok](/api-reference/health-ai/ekascribe/local-development-ngrok) to tunnel over HTTPS, or point at the development `baseUrl` (`https://api.dev.eka.care/voice/v1`) which works from plain `localhost`.
</Warning>

For the full method reference, callbacks, widget, and session utilities, see the [TypeScript SDK guide](/api-reference/health-ai/ekascribe/SDKs/TS-sdk).

***

## Explore Other Integration Options

You can also integrate EkaScribe using [other SDKs](/api-reference/health-ai/ekascribe/overview#1--sdks-recommended), [REST APIs](/api-reference/health-ai/ekascribe/ekascribe-v2/overview), or the [Chrome Extension](https://chromewebstore.google.com/detail/ekascribe-ai-powered-clin/nncfcjgelepkhpjfkejgkncdfbcfmhom).
