@capitalthought/chatbot-client
v0.1.2
Published
TypeScript client for the mikeybot messaging gateway. Handles the Ed25519 signed-request envelope and exposes typed methods for every public endpoint.
Readme
@capitalthought/chatbot-client
Typed TypeScript client for the mikeybot messaging gateway — iMessage, WhatsApp, and Slack under the [email protected] identity. Handles the Ed25519 signed-request envelope and exposes typed methods for every public endpoint.
Install
npm install @capitalthought/chatbot-clientRequires Node 20+.
Usage
import { ChatbotClient } from '@capitalthought/chatbot-client';
const client = new ChatbotClient({
baseUrl: 'https://mikeybot.capitalthought.com',
consumerId: process.env.MIKEYBOT_CONSUMER_ID!,
keyId: process.env.MIKEYBOT_KEY_ID!,
privateKey: process.env.MIKEYBOT_PRIVATE_KEY_B64!, // base64 32-byte Ed25519 seed
timeoutMs: 1500,
});
await client.sendSlack({
to: '#some-channel',
body: 'Hello from a registered consumer.',
idempotency_key: 'my-event-id:posted',
});The full surface mirrors openapi.yaml in the mikeybot repo — sendImessage, sendWhatsapp, sendSlack, registerWebhook, pullInbox, etc.
Authentication
Every consumer holds an Ed25519 keypair registered with mikeybot via mikeyctl chatbot consumer register. The private seed signs every request body; mikeybot verifies against the registered public key + the per-consumer capability allowlist.
Get your consumer credentials by running the registration verb on the mikeybot machine (Josh-side operation).
License
UNLICENSED — internal Capital Thought, LLC use. Not for public redistribution.
