Skip to content

Quick Start: SDK

Terminal window
npm install @honeybee-ai/hivemind-sdk
import { createPlatformClient } from '@honeybee-ai/hivemind-sdk';
const client = createPlatformClient({ profile: 'default' });

The client reads auth credentials from ~/.honeyb/auth/default.json (set up via wgl auth login).

const hives = await client.listHives();
for (const hive of hives) {
console.log(`${hive.name}${hive.status}`);
}
// Create
const hive = await client.createHive({
name: 'my-project',
protocol_name: 'code-review',
});
// Configure provider
await client.setSecret({
provider: 'cerebras',
key: 'csk-...',
hiveId: hive.id,
});
// Start
await client.startHive(hive.id);
import { HiveSchema } from '@honeybee-ai/hivemind-sdk/contracts';
import type { z } from 'zod';
type Hive = z.infer<typeof HiveSchema>;
// Validate API responses
const hive: Hive = HiveSchema.parse(apiResponse);
import { createTelemetryFromEnv } from '@honeybee-ai/hivemind-sdk/telemetry';
const reporter = createTelemetryFromEnv('my-project');
// Record events (fire-and-forget)
reporter.record({
type: 'llm_call',
model: 'claude-sonnet',
promptTokens: 500,
completionTokens: 200,
latencyMs: 1500,
});
import { loadConfig } from '@honeybee-ai/hivemind-sdk/config';
const config = loadConfig();
const serverUrl = config.get('server') || 'http://localhost:3100';