---
title: "Getting Started"
description: "Local, stateful API emulators for healthcare and life science development. FHIR, SMART on FHIR, EHRs, payers, and life science APIs, without PHI. Synthetic data only."
canonical_url: "https://www.emuhealth.dev/docs"
---
# Getting Started

Local drop-in replacement for Vercel, GitHub, Google, Slack, Apple, Microsoft, Okta, AWS, Resend, Stripe, MongoDB Atlas, Clerk, Linear, and Twilio APIs. Built for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation. Not mocks.

> **Synthetic data only.** emuhealth is a development and testing tool. Never load real patient data or other protected health information (PHI) into it. Emulators keep data in memory or local files with no access controls, audit logging, or encryption.

## Quick Start

```bash
npx emuhealth
```

All services listen on IPv4 loopback (`127.0.0.1`) by default. No config file needed:

- **Vercel** on `http://localhost:4000`
- **GitHub** on `http://localhost:4001`
- **Google** on `http://localhost:4002`
- **Slack** on `http://localhost:4003`
- **Apple** on `http://localhost:4004`
- **Microsoft** on `http://localhost:4005`
- **Okta** on `http://localhost:4006`
- **AWS** on `http://localhost:4007`
- **Resend** on `http://localhost:4008`
- **Stripe** on `http://localhost:4009`
- **MongoDB Atlas** on `http://localhost:4010`
- **Clerk** on `http://localhost:4011`
- **Linear** on `http://localhost:4012`
- **Twilio** on `http://localhost:4013`

Health and life science services use a fixed range starting at `http://localhost:4100`. Each health service keeps its port no matter which other services run or how many upstream services exist.

- **FHIR R4** on `http://localhost:4100`. See [FHIR R4](/docs/fhir).
- **Epic** on `http://localhost:4101`. See [Epic](/docs/epic).
- **openFDA** on `http://localhost:4102`. See [openFDA](/docs/openfda).
- **RxNav** on `http://localhost:4103`. See [RxNav](/docs/rxnav).
- **ClinicalTrials.gov** on `http://localhost:4104`. See [ClinicalTrials.gov](/docs/clinicaltrials).
- **NCBI E-utilities** on `http://localhost:4105`. See [NCBI E-utilities](/docs/ncbi).
- **NPPES NPI Registry** on `http://localhost:4106`. See [NPPES NPI Registry](/docs/nppes).
- **Benchling** on `http://localhost:4107`. See [Benchling](/docs/benchling).
- **REDCap** on `http://localhost:4108`. See [REDCap](/docs/redcap).
- **Oracle Health (Cerner)** on `http://localhost:4109`. See [Oracle Health (Cerner)](/docs/cerner).
- **athenahealth** on `http://localhost:4110`. See [athenahealth](/docs/athena).
- **CMS Blue Button 2.0** on `http://localhost:4111`. See [CMS Blue Button 2.0](/docs/bluebutton).
- **CDS Hooks** on `http://localhost:4112`. See [CDS Hooks](/docs/cdshooks).
- **Redox** on `http://localhost:4113`. See [Redox](/docs/redox).
- **AWS HealthLake** on `http://localhost:4114`. See [AWS HealthLake](/docs/healthlake).
- **Google Cloud Healthcare API** on `http://localhost:4115`. See [Google Cloud Healthcare API](/docs/gcphealthcare).
- **Azure Health Data Services** on `http://localhost:4116`. See [Azure Health Data Services](/docs/azurehealth).
- **Stedi** on `http://localhost:4117`. See [Stedi](/docs/stedi).
- **Availity** on `http://localhost:4118`. See [Availity](/docs/availity).
- **Dexcom** on `http://localhost:4119`. See [Dexcom](/docs/dexcom).
- **Fitbit** on `http://localhost:4120`. See [Fitbit](/docs/fitbit).
- **Oura** on `http://localhost:4121`. See [Oura](/docs/oura).
- **Withings** on `http://localhost:4122`. See [Withings](/docs/withings).
- **Terra** on `http://localhost:4123`. See [Terra](/docs/terra).
- **DICOMweb** on `http://localhost:4124`. See [DICOMweb](/docs/dicomweb).
- **HL7 v2 over MLLP** on `http://localhost:4125`. See [HL7 v2 over MLLP](/docs/hl7v2).
- **Veeva Vault** on `http://localhost:4126`. See [Veeva Vault](/docs/veeva).
- **Medidata Rave** on `http://localhost:4127`. See [Medidata Rave](/docs/rave).
- **Payer APIs** on `http://localhost:4128`. See [Payer APIs](/docs/payer).
- **Prior Authorization** on `http://localhost:4129`. See [Prior Authorization](/docs/priorauth).
- **IHE XDS and XCA** on `http://localhost:4130`. See [IHE XDS and XCA](/docs/xds).

## CLI

```bash
# Start all services (zero-config)
npx emuhealth

# Start specific services
npx emuhealth --service vercel,github

# Custom port
npx emuhealth --port 3000

# Use a seed config file
npx emuhealth --seed config.yaml

# Generate omitted service secrets into a private file
npx emuhealth start --seed config.yaml --generated-secrets-file .emulate-secrets.json

# Generate a starter config
npx emuhealth init

# Generate config for a specific service
npx emuhealth init --service github

# List available services
npx emuhealth list
```

## Options

<table>
  <thead>
    <tr>
      <th>Flag</th>
      <th>Default</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>-p, --port</code></td>
      <td><code>4000</code></td>
      <td>Base port (auto-increments per service; health services start at base + 100)</td>
    </tr>
    <tr>
      <td><code>--host</code></td>
      <td><code>127.0.0.1</code></td>
      <td>Listening address; use <code>0.0.0.0</code> to allow network access</td>
    </tr>
    <tr>
      <td><code>-s, --service</code></td>
      <td>all</td>
      <td>Comma-separated services to enable</td>
    </tr>
    <tr>
      <td><code>--seed</code></td>
      <td>auto-detect</td>
      <td>Path to seed config (YAML or JSON)</td>
    </tr>
    <tr>
      <td><code>--base-url</code></td>
      <td>none</td>
      <td>Override the advertised base URL (supports <code>{'{service}'}</code> template)</td>
    </tr>
    <tr>
      <td><code>--portless</code></td>
      <td>off</td>
      <td>Serve over HTTPS through portless and register service aliases</td>
    </tr>
    <tr>
      <td><code>--generated-secrets-file</code></td>
      <td>none</td>
      <td>Generate omitted service secrets and write them to a new owner-only JSON file</td>
    </tr>
  </tbody>
</table>

The generated-secrets destination must not exist. emuhealth removes inherited ACLs, verifies effective owner-only access, and publishes the complete file before startup. Handled startup failures remove the invocation-owned artifact. A hard termination can leave a complete artifact that requires manual recovery. Linux requires `setfacl` and `getfacl` from the `acl` package. The flag fails closed when access controls cannot be verified and is not supported on Windows.

The port can also be set via the `EMUHEALTH_PORT` or `PORT` environment variables. The upstream name `EMULATE_PORT` still works when `EMUHEALTH_PORT` is not set.

For access from a container or another machine, use `npx emuhealth start --host 0.0.0.0`. Set `--base-url` to a URL reachable by those clients when using OAuth redirects or other advertised URLs.

## Programmatic API

You can also use emuhealth as a library in your tests. See the [Programmatic API](/docs/programmatic-api) page for `createEmulator`, Vitest/Jest setup, and instance methods.

## Framework Integration

Embed emulators directly in your Next.js or Nuxt app so they run on the same origin. See the [Next.js Integration](/docs/nextjs) and [Nuxt Integration](/docs/nuxt) pages for setup instructions.

GitHub App flows expose secret-free installation-token metadata through an emulator-only inspection route. See the [GitHub documentation](/docs/github) for details.
