Skip to content
Fatunmbi Daniel edited this page Jul 19, 2026 · 2 revisions

@ontomorph/dtp-sdk

One typed TypeScript client for the DTP digital-twin platform. Connect to a patient's digital twin through a consent grant, read their health data by body system, watch for new events, flag findings back onto the twin, manage your API keys, and reach the HOLON clinical-knowledge API.

The problem it solves

Patient health data is spread across records and coding systems, and reaching it safely means handling consent, scoping, and authentication correctly on every call.

This SDK gives you one client that models consent as a grant, organizes data by body system, and keeps clinical fields consistent, so you write integration logic instead of transport plumbing.

Why you would want it

  • Fully typed: every request, response, and error shape is exported.
  • No runtime dependencies beyond the bundled HOLON client.
  • Runs on Node.js 18+, Bun, Deno, and any modern browser or edge runtime with fetch.
  • Consent is a first-class object (a grant), not an assumption.

What you can do

  • Connect to a patient's twin with a grant token and read data by body system.
  • Watch a twin for new health events and react as they arrive.
  • Flag findings (for example an out-of-range LDL) back onto the twin.
  • Reach HOLON for drug interactions, concept lookups, and reference ranges.

Quickstart

// quickstart.ts
import { DTP } from "@ontomorph/dtp-sdk";

const dtp = new DTP({ apiKey: process.env.DTP_API_KEY }); // dtp_live_… or dtp_test_…

// A patient issues you a grant token; connect to their twin with it.
const twin = await dtp.twins.connect(grantToken);

// Read one body system.
const cardio = await twin.systems.get("cardiovascular");
console.log(cardio.events.length, "cardiovascular events");

Pages

  • Getting-Started: install, the two credentials, configuration, and a first working call.
  • Concepts: the domain terms (twin, body system, health event, grant, key, flag, HOLON) and why each exists.
  • Guides: one section per capability, each with an example and a note on when to use it.
  • Use-Cases: four end-to-end scenarios, from a live LDL monitor to key rotation.
  • API-Reference: every export, with signatures, params, returns, and errors.
  • FAQ: auth model, streaming, runtimes, error handling, types, and more.

Clone this wiki locally