Documentation Index
Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Node.js 22+ (Maintenance LTS)
- OMOPHub API key
Installation
.d.ts types. It runs in Node ≥ 22, modern browsers (CORS permitting), and edge runtimes (Cloudflare Workers, Vercel Edge).
Quick Start
Errors Are Return Values, Not Exceptions
Every SDK method returns a discriminated{ data, error, meta, headers } union. The SDK never throws on network or API errors - narrow with if (error) ... and TypeScript will type data correctly in the success branch.
Configuration
| Option | Env var | Default |
|---|---|---|
apiKey (1st arg) | OMOPHUB_API_KEY | - (required) |
baseUrl | OMOPHUB_API_URL | https://api.omophub.com/v1 |
timeoutMs | - | 30000 (set to 0 to disable) |
maxRetries | - | 3 (set to 0 to disable) |
vocabVersion | - | unset (server picks latest) |
userAgent | - | omophub-node/<version> |
fetch | - | globalThis.fetch |
Retries
The client automatically retries429, 502, 503, 504, and transient network errors with full-jitter exponential backoff (500 ms → 8 s, capped). Retry-After is honoured up to 60 s. POST and PATCH only retry when an Idempotency-Key is set - pass it via { idempotencyKey: '...' } to opt in.
Next Steps
Concepts
Get, batch, and explore concepts
Search
Keyword, semantic, autocomplete
Mappings
Map between vocabularies
Error Handling
Discriminated errors, retries, async iterators