npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bothive-sdk

v1.0.1

Published

The official BotHive SDK for building and deploying AI agents.

Downloads

16

Readme

bothive-sdk

Import your BotHive AI bots into any TypeScript or Node.js project.

Build bots with HiveLang on BotHive, deploy them, and use them anywhere.

Install

npm install bothive-sdk

Quick Start

import { BothiveClient } from 'bothive-sdk';

const client = new BothiveClient({
  apiKey: process.env.BOTHIVE_API_KEY!
});

// One-shot chat
const reply = await client.chat('What is HiveLang?', {
  botId: 'your-bot-id'
});
console.log(reply.response);

Multi-Turn Conversations

const bot = client.bot('your-bot-id');

const r1 = await bot.chat('My name is Alex');
console.log(r1.response); // "Nice to meet you, Alex!"

const r2 = await bot.chat('What is my name?');
console.log(r2.response); // "Your name is Alex!"

// Reset when needed
bot.clearHistory();

Next.js API Route Example

// app/api/chat/route.ts
import { BothiveClient } from 'bothive-sdk';
import { NextRequest, NextResponse } from 'next/server';

const client = new BothiveClient({
  apiKey: process.env.BOTHIVE_API_KEY!
});

export async function POST(req: NextRequest) {
  const { message, botId } = await req.json();

  const reply = await client.chat(message, { botId });

  return NextResponse.json({ response: reply.response });
}

React Component Example

'use client';
import { useState } from 'react';

export function ChatWidget({ botId }: { botId: string }) {
  const [messages, setMessages] = useState<{ role: string; content: string }[]>([]);
  const [input, setInput] = useState('');

  const send = async () => {
    setMessages(prev => [...prev, { role: 'user', content: input }]);

    const res = await fetch('/api/chat', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ message: input, botId }),
    });

    const data = await res.json();
    setMessages(prev => [...prev, { role: 'assistant', content: data.response }]);
    setInput('');
  };

  return (
    <div>
      {messages.map((m, i) => (
        <div key={i}>{m.role}: {m.content}</div>
      ))}
      <input value={input} onChange={e => setInput(e.target.value)} />
      <button onClick={send}>Send</button>
    </div>
  );
}

List Your Bots

const bots = await client.listBots();
bots.forEach(bot => {
  console.log(`${bot.name} (${bot.id}) - ${bot.status}`);
});

Deploy a Bot Programmatically

const result = await client.deploy({
  name: 'CustomerBot',
  hivelangCode: `
    bot CustomerBot {
      instructions {
        You are a friendly customer support agent.
        Help users with their questions about billing and accounts.
      }
      capabilities [general.respond]
    }
  `,
  description: 'Handles customer inquiries',
});

console.log(`Deployed! Bot ID: ${result.botId}`);

API Reference

BothiveClient

| Method | Description | |--------|-------------| | chat(message, options?) | Send a one-shot message to a bot | | bot(botId) | Get a Bot instance for multi-turn conversation | | listBots() | List all your deployed bots | | deploy(options) | Deploy a HiveLang bot |

Bot

| Method | Description | |--------|-------------| | chat(message) | Send a message (history tracked automatically) | | clearHistory() | Reset conversation history | | getHistory() | Get current conversation history |

Get Your API Key

  1. Sign in at bothive.cloud
  2. Go to Dashboard → Developer → API Keys
  3. Create a new key
  4. Add it to your .env:
BOTHIVE_API_KEY=bh_your_key_here

License

MIT — BotHive Inc.