Skip to content

Getting Started

Fatunmbi Daniel edited this page Jul 24, 2026 · 2 revisions

Getting Started

Install the client, create it with an API key, and make one working call.

Install

npm install @ontomorph/holon-client
pnpm add @ontomorph/holon-client
yarn add @ontomorph/holon-client
bun add @ontomorph/holon-client

The client has one dependency, @ontomorph/holon-types, which carries the shared enums, error classes, and entity types. See FAQ for how the two packages relate.

Runtime support

Runs on Node.js 18+, Bun, Deno, and any runtime with a global fetch. No polyfill is needed on those runtimes.

Authentication

Every request carries a bearer API key, sent as the header Authorization: Bearer <apiKey>. You pass the key once when you create the client, and the client attaches it to each request.

Keys start with the holon_ prefix. Request one through the developer dashboard. Keep the key out of source control and read it from the environment.

Configuration

createHolonClient takes three options.

apiUrl

The HOLON API base URL, for example https://holon-api.ontomorph.com. Required, type string.

apiKey

Your holon_… key, sent as a bearer token. Required, type string.

timeout

Per-request timeout in milliseconds, applied via AbortSignal.timeout. Optional, type number. A request that exceeds it throws (see error handling in API-Reference).

// client.ts
import { createHolonClient } from "@ontomorph/holon-client";

export const holon = createHolonClient({
  apiUrl: "https://holon-api.ontomorph.com",
  apiKey: process.env.HOLON_API_KEY, // holon_…
  timeout: 30_000,
});

Your first call

Search returns a page of hits. Read the first one.

// first-call.ts
import { holon } from "./client";

const results = await holon.concepts.search("metformin");
const top = results.hits[0];

console.log(top.conceptId);   // stable numeric id
console.log(top.conceptName); // human-readable name
console.log(top.vocabularyId, top.domainId);

From here, Guides walks each namespace, and Use-Cases shows four full scenarios.

Clone this wiki locally