Example projects
Ten production-grade runnable examples covering every public surface of the OHM SDK — from a 30-line CLI to a 4-tab React Native demo.
Example projects
Every example below lives at
github.com/open-holistic-medicine/ohm-sdk/tree/main/examples.
Each one is idiot-proof: graceful fallback on missing env, typed
error handling for all 10 OHM*Error classes, a copy-paste 3-step
quickstart in its README, and verified tsc --noEmit clean.
All examples are pinned to
@ohm_studio/sdk@^0.12.0 / @ohm_studio/sdk-react-native@^0.12.0.
Start here — the full demo
This is the canonical end-to-end demo. 33 TS files, ~4500 lines, full typecheck clean. Clone it and you have a working production-shape app.
Hospital-integration kit (paired Studio + RN)
For inpatient ward EMRs replacing a webkitSpeechRecognition + regex
parser. Two paired folders — Studio side first, then drop the RN
screens into your existing app.
hospital-integration
3 published Studio schemas (vitals · doctor-note · nurse-shift) + sanity probe. Step-by-step Studio config.
clinical-station-rn
3 drop-in React Native screens that call those schemas, plus 6 more demoing the rest of the SDK.
Visit feature (canonical EMR sample)
visit-feature-expo
Mobile visit feature — 3 screens, AsyncStorage persistence, useRecorder auto-extract.
visit-feature-nextjs
Web visit feature — 3 routes, server-action-protected key. Mirrors the Expo demo.
The Visit feature cookbook walks through the architecture in prose.
Production patterns
webhook-receiver
Express 5 + node:crypto. HMAC-SHA256 verification, X-OHM-Delivery-Id dedupe, dispatch for 6 event types including async-job callbacks (job.completed / job.failed / job.cancelled).
streaming
Next.js 15 SSE — audio.extractStream(). Transcript renders before the structured JSON arrives. Halves perceived latency for clinical UIs.
Minimal SDK demos
node-cli
Node 18+ CLI with six subcommands: summarize, extract, transcribe, async (extractAsync), list (apis.list), show (apis.get).
nextjs-server-action
Browser Recorder + server-action wrapping ohm.audio.extract. Live key stays server-side.
expo-mic-recorder
Smallest one-screen Expo demo of useRecorder.
react-native-bare
Bare RN + react-native-audio-recorder-player. Same lifecycle as ExpoRecorder, no Expo dependency.
Pairs that go together
| If you want to… | Read these together |
|---|---|
| Build a hospital RN app end-to-end | hospital-integration (Studio schemas) → clinical-station-rn (RN UI) |
| Long recordings with backend callbacks | clinical-station-rn (Async tab in webhook mode) ⇄ webhook-receiver (your backend) |
| Submit async jobs from a script | node-cli (npm start async) ⇄ webhook-receiver |
| Server-side proxy for a web/mobile client | nextjs-server-action (sync) or streaming (SSE) |
What every example guarantees
| Guarantee | How |
|---|---|
| No silent crash on missing config | Each example detects an unset/placeholder OHM_API_KEY and prints a 3-step fix (Node) or shows a setup screen (RN). |
| Typed-error catching | All 10 OHM*Error classes — OHMAuthError, OHMValidationError, OHMRateLimitError, OHMNotFoundError, OHMTimeoutError, OHMNetworkError, OHMServerError, OHMQuotaExceededError, OHMAbortError, OHMConfigError — each with a friendly user-facing message. |
| English transcripts | Speak any of 23 supported languages — audio.transcribe / audio.extract always return clean English text. |
| Live keys never bundle | RN examples show the test-key + acknowledgeBundledKey pattern. Server examples keep ohms_live_* server-side via env. |
| Real npm packages | All examples install the published SDKs from npm — no workspace links — so you see exactly what a customer sees after npm install. |
Run any example in 3 steps
cd examples/<sample>
npm install
cp .env*.example .env* # copy + edit per the sample's README
npm start # or `npm run dev`, `npm run probe` — see READMEThe shortest path to a working SDK call:
cd examples/node-cli
npm install
echo "OHM_API_KEY=ohms_test_xxx" > .env
npm start summarize ./consult.txtWhere to mint the key: studio.ohm.doctor
→ Keys → New key → Test mode. Test keys (ohms_test_*) are safe to
ship in dev bundles; live keys (ohms_live_*) belong in your backend's
secrets manager — see RN key handling.