Skip to main content

Features

  • Complete TypeScript Support - Full type safety with intelligent autocomplete
  • Healthcare Module Coverage - Appointments, Patients, Medications, Health Assessments, ABHA (coming soon)
  • Easy Integration - Simple setup for Node.js, Next.js, and React applications
  • Production Ready - Robust error handling and validation
  • Auth - you as a third party dev dont need to worry about auth or refresh token. since the SDK takes care of it. and everytime you call any of the SDK modules and fns it will automatically manage the auth token and its life-cycle and renewal

Installation


⚠️ IMPORTANT NOTE BEFORE YOU START USING THE SDK

The SDK can be used on both BE and FE — just with different configs. If you initialize the SDK in a backend JS/TS runtime like Node, Express, Next, etc., you can use a straightforward config. We’ve also made it FE-compatible with a slightly different setup.

Setup for BE runtimes

You can initialize the SDK in your backend environment by simply passing the client_id, client_secret, and api_key.
⚠️ Make sure to store these credentials securely and never expose them on the frontend.

Setup for FE runtimes (React, Next.js, etc.)

To use the SDK in a client-side web app, you’ll need to use a token-based flow and set up a small backend auth proxy. Here’s how:
And you’re GTG! You can initialize it once (maybe in a useEffect with empty dependencies) and take it for a spin. The SDK is now fully FE-compatible.

Get the backend up and running for FE auth

Only needed if you’re using the SDK on the frontend. We have starter templates you can deploy instantly: one click deployment button in the repo’s readme Use these to deploy the /api/manage-auth route mentioned above. hence
  • deploy the repo that you wish to use (express or Next)
  • follow the deployment guidelines in the repo’s readme
  • have the backend up and running and you can now initialize the SDK on FE as well
  • by first calling the backend api that you just deployed, and getting the auth token
  • and initing the SDK on client side

Setup for BE runtimes

Next.js API Route Example


Module Documentation

Appointments Module

Manage doctor appointments and schedules.

Patients Module

Patient registration and management.

Medication Search Module

Search and find medications.

Health Assessment Module

Comprehensive health assessment and symptom checking.

TypeScript Autocomplete

The SDK provides full TypeScript support with intelligent autocomplete. Press Ctrl+Space to see available options, methods, args and responses: TypeScript Autocomplete

Configuration

Environment Variables

Create a .env.local file:

TypeScript Configuration

Ensure your tsconfig.json includes:

Response Types

All methods return properly typed responses:

Error Handling

The SDK would never break the app and has try/catch at every important step. but for proper UX its recommended to wrap its usage with your own try/catch or .then and .catch

Requirements

  • Node.js 16+
  • TypeScript 4.5+ (recommended)
  • Valid Eka Care API credentials

NPM