Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.medera.info/llms.txt

Use this file to discover all available pages before exploring further.

The Medera JavaScript SDK works in Node.js 18+, modern browsers, Bun, Deno, and edge runtimes (Cloudflare Workers, Vercel Edge).

Install

npm install @medera/sdk
# or
pnpm add @medera/sdk
# or
yarn add @medera/sdk

Quick start

import { MederaAuth, MederaClient } from '@medera/sdk';

const auth = new MederaAuth({
  clientId: process.env.MEDERA_CLIENT_ID!,
  clientSecret: process.env.MEDERA_CLIENT_SECRET!,
  audience: 'api.medera.ai',
});

const client = new MederaClient({ auth });

const session = await client.sessions.create({
  patient_id: 'pat_abc',
  provider_id: 'prv_xyz',
  visit_type: 'psychiatry_followup',
});

What’s in the box

  • REST client for every API resource
  • WebSocket clients for /streams, /transcribe, and /therapy
  • Auth helpers with automatic token refresh
  • Webhook signature verification
  • TypeScript types for every resource
  • Built-in retry with exponential backoff
  • Request idempotency support