Developers

TypeScript SDK

A typed client for HiveBase context, decisions, sync cursors, and receipts.

Last updated 2026-07-29
npm install @hivebase/sdk
import { HiveBase } from "@hivebase/sdk";

const hb = new HiveBase({ apiKey: process.env.HIVEBASE_API_KEY });

const brief = await hb.context.brief({
  query: "What changed in our launch plan?",
});

const receipt = await hb.context.remember({
  idempotency_key: "launch-session-2026-07-29",
  kind: "commitment",
  content: "Ship context continuity before action packs.",
  topics: ["platform-api", "launch"],
});

if (receipt.state !== "applied") {
  await hb.receipts.get(receipt.receipt_id);
}

const sync = await hb.context.sync({ cursor: previousCursor });
await saveCursor(sync.cursor);

The public domains are:

  • hb.context.brief, search, sync, remember
  • hb.decisions.search, record
  • hb.receipts.get

The SDK throws typed transport errors and exposes the safe domain PlatformError when a tool reports an error.