BotHive SDK Reference

The official TypeScript/Node.js client for integrating BotHive agents into your applications.

$ npm install @bothive/sdk

Quick Start

import { BothiveClient } from '@bothive/sdk';

const client = new BothiveClient({
  apiKey: process.env.BOTHIVE_API_KEY, // Get from Dashboard
  mode: 'api' // or 'demo' for testing
});

const response = await client.runBot({
  botId: 'your-bot-slug',
  prompt: 'Analyze this sales data...'
});

console.log(response.response);

Client Options

PropertyTypeDescription
apiKeystringYour API Key from Settings.
mode'api' | 'demo'Use 'demo' to return mock responses without hitting the API (great for testing UI).
baseUrlstringOptional. Override endpoint (e.g. self-hosted).

Methods

runBot(params)Promise<BotRunResponse>

Executes a bot with a given prompt.

ping()Promise<boolean>

Checks connectivity to the BotHive Cloud.

How helpful was this page?

Not helpfulExcellent