P
Pharmako
Pricing
Docs
Back to SDKs
TypeScript / JavaScriptv3.2.0

TypeScript SDK

The official Pharmako SDK for TypeScript and JavaScript applications.

View on GitHubnpm Package

Installation

npm install @pharmako/sdk

Or using yarn or pnpm:

yarn add @pharmako/sdkpnpm add @pharmako/sdk

Quick Start

import { Pharmako } from '@pharmako/sdk';

// Initialize the client
const pharmako = new Pharmako({
  apiKey: process.env.PHARMAKO_API_KEY,
});

// Fetch a patient
const patient = await pharmako.patients.get('patient_123');
console.log(patient.name);

// List lab results
const labs = await pharmako.labs.list({
  patientId: 'patient_123',
  limit: 10,
});

// Create a webhook subscription
const webhook = await pharmako.webhooks.create({
  url: 'https://your-app.com/webhooks',
  events: ['patient.updated', 'lab.completed'],
});

TypeScript Support

The SDK is written in TypeScript and includes full type definitions for all API responses.

import { Pharmako, Patient, LabResult } from '@pharmako/sdk';

const pharmako = new Pharmako({ apiKey: '...' });

// Fully typed responses
const patient: Patient = await pharmako.patients.get('patient_123');

// Type-safe filters
const labs: LabResult[] = await pharmako.labs.list({
  patientId: patient.id,
  status: 'completed', // Autocomplete available
  orderBy: 'created_at',
});

Error Handling

import { Pharmako, PharmakoError } from '@pharmako/sdk';

try {
  const patient = await pharmako.patients.get('invalid_id');
} catch (error) {
  if (error instanceof PharmakoError) {
    console.error('API Error:', error.message);
    console.error('Status:', error.status);
    console.error('Code:', error.code);
  }
}

Next Steps

API Reference

Explore all available methods and parameters.

View Reference

Examples

See real-world implementation examples.

View Examples
P
Pharmako

Powering the future of healthcare with modern API infrastructure.

TwitterGitHubLinkedIn

Product

  • Overview
  • Features
  • Pricing
  • Changelog
  • Documentation

Developers

  • API Reference
  • SDKs
  • Webhooks
  • Status
  • Community

Company

  • About
  • Blog
  • Careers
  • Press
  • Contact

Legal

  • Privacy
  • Terms
  • Security
  • HIPAA

© 2025 Pharmako, Inc. All rights reserved.

All systems operational