[](https://twitter.com/chatbotkit)
[](https://chatbotkit.com)
[](https://cbk.ai)
[](mailto:support@chatbotkit.com)
[](https://go.cbk.ai/discord)
```text
.d8888b. 888888b. 888 d8P
d88P Y88b 888 "88b 888 d8P
888 888 888 .88P 888 d8P
888 8888888K. 888d88K
888 888 "Y88b 8888888b
888 888 888 888 888 Y88b
Y88b d88P 888 d88P 888 Y88b
"Y8888P" 8888888P" 888 Y88b .ai
```
# ChatBotKit Node SDK
Welcome to the ChatBotKit Node SDK. This SDK offers a JavaScript-based platform for effortlessly building conversational AI bots and agents. With [ChatBotKit](https://chatbotkit.com), you can swiftly develop and deploy AI bots capable of natural language interactions.
This is a meta repository for the ChatBotKit Node SDK. It contains the SDK packages for a number of popular platforms and frameworks such as **React**, **Next.js**, **NextAuth** and more.
## Main Packages
The ChatBotKit Node SDK is comprised of the following packages:
| Package | Version | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [@chatbotkit/cli](https://github.com/chatbotkit/node-sdk/tree/main/packages/cli) | [](https://www.npmjs.com/package/@chatbotkit/cli) | The ChatBotKit CLI. |
| [@chatbotkit/sdk](https://github.com/chatbotkit/node-sdk/tree/main/packages/sdk) | [](https://www.npmjs.com/package/@chatbotkit/sdk) | The ChatBotKit API SDK. |
| [@chatbotkit/agent](https://github.com/chatbotkit/node-sdk/tree/main/packages/agent) | [](https://www.npmjs.com/package/@chatbotkit/agent) | The ChatBotKit Agent SDK. |
| [@chatbotkit/react](https://github.com/chatbotkit/node-sdk/tree/main/packages/react) | [](https://www.npmjs.com/package/@chatbotkit/react) | The ChatBotKit React SDK. |
| [@chatbotkit/next](https://github.com/chatbotkit/node-sdk/tree/main/packages/next) | [](https://www.npmjs.com/package/@chatbotkit/next) | The ChatBotKit Next.js SDK. |
| [@chatbotkit/nextauth](https://github.com/chatbotkit/node-sdk/tree/main/packages/nextauth) | [](https://www.npmjs.com/package/@chatbotkit/nextauth) | The ChatBotKit NextAuth.js SDK. |
| [@chatbotkit/widget](https://github.com/chatbotkit/node-sdk/tree/main/packages/widget) | [](https://www.npmjs.com/package/@chatbotkit/widget) | The ChatBotKit Widget types and utilities. |
| [@chatbotkit/fetch](https://github.com/chatbotkit/node-sdk/tree/main/packages/fetch) | [](https://www.npmjs.com/package/@chatbotkit/fetch) | The ChatBotKit isometric fetch implementation. |
## Other Tools
This repository also contains the following tools:
| Package | Version | Description |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [create-cbk-app](https://github.com/chatbotkit/node-sdk/tree/main/tools/create-cbk-app) | [](https://www.npmjs.com/package/create-cbk-app) | A quick tool to create a new CBK application. |
## Why ChatBotKit?
**Build lighter, future-proof AI agents.** When you build with ChatBotKit, the heavy lifting happens on our servers-not in your application. This architectural advantage delivers:
- ๐ชถ **Lightweight Agents**: Your agents stay lean because complex AI processing, model orchestration, and tool execution happen server-side. Less code in your app means faster load times and simpler maintenance.
- ๐ก๏ธ **Robust & Streamlined**: Server-side processing provides a more reliable experience with built-in error handling, automatic retries, and consistent behavior across all platforms.
- ๐ **Backward & Forward Compatible**: As AI technology evolves-new models, new capabilities, new paradigms-your agents automatically benefit. No code changes required on your end.
- ๐ฎ **Future-Proof**: Agents you build today will remain capable tomorrow. When we add support for new AI models or capabilities, your existing agents gain those powers without any updates to your codebase.
This means you can focus on building great user experiences while ChatBotKit handles the complexity of the ever-changing AI landscape.
## SDK Features
- **Easy Setup**: Quick and straightforward installation process.
- **Serverless Compatibility**: Works seamlessly with modern runtime environments like Serverless, Edge, Vercel, Netlify, Cloudflare Workers, Deno, AWS Lambda, and more.
- **Modern Framework Support**: Built-in support for CommonJS, ECMAScript Modules, async/await, streams, etc.
- **Customizability**: Tailor the chatbotโs behavior and responses to fit specific use cases.
- **Multi-Platform**: Deploy chatbots on websites, mobile apps, and messaging platforms like Slack, Discord, and WhatsApp.
- **Multi-Model**: Support for a wide range of language models, including GPT-3, GPT-4, Claude, and more.
## ChatBotKit Capabilities
- ๐ **Multi-modal Support**: Support various language and image models from all vendors such as OpenAI, Anthropic, Mistral, AWS, Google and others.
- ๐ **Multi-language Support**: Allowing for easy customization and use in diverse linguistic contexts.
- ๐ฌ **Conversation Management**: Manage complex conversation flaws with ease.
- ๐จ **Chat History**: Review and reference past conversations.
- ๐พ **Custom Datasets**: Organize data for bot responses.
- ๐ก **Custom Skillset**: Equip chatbots with unique abilities like image generation or web fetching.
- ๐ **Document File Importing**: Import various document file types into chatbot datasets.
- ๐ต **Media File Importing**: Import a range of media file formats into chatbot datasets.
- ๐ **Widget Integration**: Seamlessly embed chatbots on websites with customizable options.
- ๐ฌ **Slack, Discord, WhatsApp Bot Integrations**: Easy integration with popular messaging platforms.
- ๐บ **Sitemap Integration**: Ingest website content into a searchable knowledge base.
- ๐ฅ **Streaming**: Enable/disable streaming capabilities.
- ๐ **Data Security**: Robust measures to protect user data.
- ๐ต **Privacy Focus**: Strong privacy controls to ensure responsible data handling.
- ๐ซ **Content Moderation**: Automatic scanning and flagging of abusive content.
- ๐ต **Simple Pricing**: Transparent and straightforward pricing.
## Getting Started
Follow these steps to start with ChatBotKit:
1. **Installation**:
```bash
npm install @chatbotkit/sdk
```
2. **Usage**: Implement the SDK in your chatbot project.
### Streaming Example
This example demonstrates streaming capabilities in Edge and Serverless environments:
```javascript
import { ConversationClient } from '@chatbotkit/sdk/conversation/index.js'
const client = new ConversationClient(/* configuration */)
for await (const { type, data } of client
.complete(null, { model: 'gpt-4', messages })
.stream()) {
if (type === 'token') {
process.stdout.write(data.token)
}
}
```
### NextGen Example for Next.js
This example showcases how to build advanced conversational AI with streaming,
function calls, server-side rendering and much more in a Next.js project:
```javascript
// file: ./app/page.jsx
import ChatArea from '../components/ChatArea.jsx'
export default function Page() {
return