Kerabie
SDKs

TypeScript / Node.js SDK

Build server-side integrations with the Kerabie TypeScript SDK.

The @kerabie/sdk package lets you integrate Kerabie into your backend, server-side scripts, or custom tooling.

Install

npm install @kerabie/sdk

Initialize

import { KerAbieClient } from '@kerabie/sdk';

const kerabie = new KerAbieClient({
  apiKey: process.env.KERABIE_API_KEY!,   // Settings → API → New API Key
  orgId: 42,                               // Your org ID
  // baseUrl: 'https://api.kerabie.com',  // default
});

Conversations

// List open conversations
const { conversations, total } = await kerabie.conversations.list({
  status: 'open',
  page: 1,
  limit: 20,
});

// Get a conversation
const conv = await kerabie.conversations.get(conversationId);

// Resolve
await kerabie.conversations.resolve(conversationId);

// Assign to agent
await kerabie.conversations.assign(conversationId, { agentId: 7 });

// Send a message as a bot/agent
await kerabie.conversations.sendMessage(conversationId, {
  body: 'Your order has been shipped!',
  senderType: 'bot',
});

Customers

// Look up by email
const customer = await kerabie.customers.getByEmail('jane@example.com');

// List all customers
const { customers } = await kerabie.customers.list({ page: 1 });

// Update attributes
await kerabie.customers.update(customerId, {
  name: 'Jane Smith',
  attributes: { plan: 'pro', company: 'Acme' },
});

// Delete (GDPR)
await kerabie.customers.delete(customerId);

Knowledge Base

// Search articles
const results = await kerabie.kb.search('refund policy');

// List all articles
const { articles } = await kerabie.kb.list({ category: 'billing' });

// Get one article
const article = await kerabie.kb.get('how-to-cancel');

Analytics

// Summary for a date range
const summary = await kerabie.analytics.summary({
  from: '2026-05-01',
  to: '2026-05-26',
});
// → { conversations, avgResponseTime, resolvedRate, satisfactionScore }

// Agent performance
const agentStats = await kerabie.analytics.agents({ from: '2026-05-01' });

Webhooks

// Verify an incoming webhook (use with express.raw middleware)
const isValid = KerAbieClient.webhooks.verify(
  req.body,                                  // raw Buffer
  req.headers['x-kerabie-signature'],
  process.env.KERABIE_WEBHOOK_SECRET!,
);

// Parse the event
const event = KerAbieClient.webhooks.parse(req.body);
// → { event: 'conversation.created', orgId: 42, data: { ... } }

Resources reference

ResourceMethods
conversationslist, get, resolve, close, assign, sendMessage
customerslist, get, getByEmail, update, delete
visitorslist, get, block
agentslist, get
kblist, search, get
analyticssummary, agents
webhooksverify (static), parse (static)

Error handling

All methods throw KerAbieError on failure:

import { KerAbieError } from '@kerabie/sdk';

try {
  await kerabie.conversations.get(99999);
} catch (err) {
  if (err instanceof KerAbieError) {
    console.log(err.status);  // 404
    console.log(err.message); // "Conversation not found"
  }
}

Use with an AI assistant

Connect the Kerabie MCP server to Claude, Cursor or another MCP client and it can search these docs, read the TypeScript SDK types and follow the integration guide while it writes code for you. No API key is needed for that.