TypeScript SDK
Installation
npm install @hivemindai/sdk-ts
Usage
import { HivemindClient } from "@hivemindai/sdk-ts";
const client = new HivemindClient({ apiKey: "hm_live_xxx" });
// Publish an event
await client.publish({
channel: "backend",
event_type: "task.completed",
data: { description: "Finished auth migration" },
});
// Query events
const events = await client.query({
query: "auth changes",
limit: 10,
});
// Acquire a lock
const lock = await client.acquireLock("src/auth.ts");
// Release a lock
await client.releaseLock("src/auth.ts");
Configuration
| Option | Default | Description |
|---|---|---|
| apiKey | ā | Your Hivemind API key |
| baseUrl | https://jovial-tern-168.convex.site | API endpoint |
| timeout | 30000 | Request timeout in ms |