{"id":13708077,"url":"https://github.com/chatbotkit/node-sdk","last_synced_at":"2026-05-17T12:16:47.764Z","repository":{"id":153124089,"uuid":"628194741","full_name":"chatbotkit/node-sdk","owner":"chatbotkit","description":"The ChatBotKit Node SDK offers a JavaScript-based platform for effortlessly building conversational AI bots and agents.","archived":false,"fork":false,"pushed_at":"2026-01-23T13:49:07.000Z","size":4633,"stargazers_count":73,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-23T19:45:42.295Z","etag":null,"topics":["agents","ai","anthropic","chatbotkit","generative-ai","generative-ui","mistral","nextjs","nodejs","openai","rag","reactjs","sdk"],"latest_commit_sha":null,"homepage":"https://chatbotkit.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chatbotkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-15T07:31:17.000Z","updated_at":"2026-01-23T13:46:45.000Z","dependencies_parsed_at":"2024-04-13T02:44:32.205Z","dependency_job_id":"0453abb5-330d-46f1-b5d7-6035cea6cfd7","html_url":"https://github.com/chatbotkit/node-sdk","commit_stats":{"total_commits":555,"total_committers":3,"mean_commits":185.0,"dds":"0.24864864864864866","last_synced_commit":"2c63893da309fe3e100dbc1de96fb47f1ccef5d6"},"previous_names":[],"tags_count":345,"template":false,"template_full_name":null,"purl":"pkg:github/chatbotkit/node-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatbotkit%2Fnode-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatbotkit%2Fnode-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatbotkit%2Fnode-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatbotkit%2Fnode-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chatbotkit","download_url":"https://codeload.github.com/chatbotkit/node-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatbotkit%2Fnode-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28764868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T00:37:26.264Z","status":"online","status_checked_at":"2026-01-26T02:00:08.215Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","anthropic","chatbotkit","generative-ai","generative-ui","mistral","nextjs","nodejs","openai","rag","reactjs","sdk"],"created_at":"2024-08-02T22:01:55.360Z","updated_at":"2026-04-20T11:03:31.988Z","avatar_url":"https://github.com/chatbotkit.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Follow on Twitter](https://img.shields.io/twitter/follow/chatbotkit.svg?logo=twitter)](https://twitter.com/chatbotkit)\n[![ChatBotKit](https://img.shields.io/badge/credits-ChatBotKit-blue.svg)](https://chatbotkit.com)\n[![CBK.AI](https://img.shields.io/badge/credits-CBK.AI-blue.svg)](https://cbk.ai)\n[![Email](https://img.shields.io/badge/Email-Support-blue?logo=mail.ru)](mailto:support@chatbotkit.com)\n[![Discord](https://img.shields.io/badge/Discord-Support-blue?logo=discord)](https://go.cbk.ai/discord)\n\n```text\n .d8888b.  888888b.   888    d8P\nd88P  Y88b 888  \"88b  888   d8P\n888    888 888  .88P  888  d8P\n888        8888888K.  888d88K\n888        888  \"Y88b 8888888b\n888    888 888    888 888  Y88b\nY88b  d88P 888   d88P 888   Y88b\n \"Y8888P\"  8888888P\"  888    Y88b .ai\n```\n\n# ChatBotKit Node SDK\n\nWelcome 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.\n\nThis 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.\n\n## Main Packages\n\nThe ChatBotKit Node SDK is comprised of the following packages:\n\n| Package                                                                                    | Version                                                                                                             | Description                                    |\n| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |\n| [@chatbotkit/cli](https://github.com/chatbotkit/node-sdk/tree/main/packages/cli)           | [![NPM](https://img.shields.io/npm/v/@chatbotkit/cli.svg)](https://www.npmjs.com/package/@chatbotkit/cli)           | The ChatBotKit CLI.                            |\n| [@chatbotkit/sdk](https://github.com/chatbotkit/node-sdk/tree/main/packages/sdk)           | [![NPM](https://img.shields.io/npm/v/@chatbotkit/sdk.svg)](https://www.npmjs.com/package/@chatbotkit/sdk)           | The ChatBotKit API SDK.                        |\n| [@chatbotkit/agent](https://github.com/chatbotkit/node-sdk/tree/main/packages/agent)       | [![NPM](https://img.shields.io/npm/v/@chatbotkit/agent.svg)](https://www.npmjs.com/package/@chatbotkit/agent)       | The ChatBotKit Agent SDK.                      |\n| [@chatbotkit/react](https://github.com/chatbotkit/node-sdk/tree/main/packages/react)       | [![NPM](https://img.shields.io/npm/v/@chatbotkit/react.svg)](https://www.npmjs.com/package/@chatbotkit/react)       | The ChatBotKit React SDK.                      |\n| [@chatbotkit/next](https://github.com/chatbotkit/node-sdk/tree/main/packages/next)         | [![NPM](https://img.shields.io/npm/v/@chatbotkit/next.svg)](https://www.npmjs.com/package/@chatbotkit/next)         | The ChatBotKit Next.js SDK.                    |\n| [@chatbotkit/nextauth](https://github.com/chatbotkit/node-sdk/tree/main/packages/nextauth) | [![NPM](https://img.shields.io/npm/v/@chatbotkit/nextauth.svg)](https://www.npmjs.com/package/@chatbotkit/nextauth) | The ChatBotKit NextAuth.js SDK.                |\n| [@chatbotkit/widget](https://github.com/chatbotkit/node-sdk/tree/main/packages/widget)     | [![NPM](https://img.shields.io/npm/v/@chatbotkit/widget.svg)](https://www.npmjs.com/package/@chatbotkit/widget)     | The ChatBotKit Widget types and utilities.     |\n| [@chatbotkit/fetch](https://github.com/chatbotkit/node-sdk/tree/main/packages/fetch)       | [![NPM](https://img.shields.io/npm/v/@chatbotkit/fetch.svg)](https://www.npmjs.com/package/@chatbotkit/fetch)       | The ChatBotKit isometric fetch implementation. |\n\n## Other Tools\n\nThis repository also contains the following tools:\n\n| Package                                                                                 | Version                                                                                                 | Description                                   |\n| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------- |\n| [create-cbk-app](https://github.com/chatbotkit/node-sdk/tree/main/tools/create-cbk-app) | [![NPM](https://img.shields.io/npm/v/create-cbk-app.svg)](https://www.npmjs.com/package/create-cbk-app) | A quick tool to create a new CBK application. |\n\n## Why ChatBotKit?\n\n**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:\n\n- 🪶 **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.\n\n- 🛡️ **Robust \u0026 Streamlined**: Server-side processing provides a more reliable experience with built-in error handling, automatic retries, and consistent behavior across all platforms.\n\n- 🔄 **Backward \u0026 Forward Compatible**: As AI technology evolves-new models, new capabilities, new paradigms-your agents automatically benefit. No code changes required on your end.\n\n- 🔮 **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.\n\nThis means you can focus on building great user experiences while ChatBotKit handles the complexity of the ever-changing AI landscape.\n\n## SDK Features\n\n- **Easy Setup**: Quick and straightforward installation process.\n- **Serverless Compatibility**: Works seamlessly with modern runtime environments like Serverless, Edge, Vercel, Netlify, Cloudflare Workers, Deno, AWS Lambda, and more.\n- **Modern Framework Support**: Built-in support for CommonJS, ECMAScript Modules, async/await, streams, etc.\n- **Customizability**: Tailor the chatbot’s behavior and responses to fit specific use cases.\n- **Multi-Platform**: Deploy chatbots on websites, mobile apps, and messaging platforms like Slack, Discord, and WhatsApp.\n- **Multi-Model**: Support for a wide range of language models, including GPT-3, GPT-4, Claude, and more.\n\n## ChatBotKit Capabilities\n\n- 🔄 **Multi-modal Support**: Support various language and image models from all vendors such as OpenAI, Anthropic, Mistral, AWS, Google and others.\n- 🌍 **Multi-language Support**: Allowing for easy customization and use in diverse linguistic contexts.\n- 💬 **Conversation Management**: Manage complex conversation flaws with ease.\n- 🗨 **Chat History**: Review and reference past conversations.\n- 💾 **Custom Datasets**: Organize data for bot responses.\n- 💡 **Custom Skillset**: Equip chatbots with unique abilities like image generation or web fetching.\n- 📄 **Document File Importing**: Import various document file types into chatbot datasets.\n- 🎵 **Media File Importing**: Import a range of media file formats into chatbot datasets.\n- 🌐 **Widget Integration**: Seamlessly embed chatbots on websites with customizable options.\n- 💬 **Slack, Discord, WhatsApp Bot Integrations**: Easy integration with popular messaging platforms.\n- 🗺 **Sitemap Integration**: Ingest website content into a searchable knowledge base.\n- 🎥 **Streaming**: Enable/disable streaming capabilities.\n- 🔒 **Data Security**: Robust measures to protect user data.\n- 🕵 **Privacy Focus**: Strong privacy controls to ensure responsible data handling.\n- 🚫 **Content Moderation**: Automatic scanning and flagging of abusive content.\n- 💵 **Simple Pricing**: Transparent and straightforward pricing.\n\n## Getting Started\n\nFollow these steps to start with ChatBotKit:\n\n1. **Installation**:\n   ```bash\n   npm install @chatbotkit/sdk\n   ```\n2. **Usage**: Implement the SDK in your chatbot project.\n\n### Streaming Example\n\nThis example demonstrates streaming capabilities in Edge and Serverless environments:\n\n```javascript\nimport { ConversationClient } from '@chatbotkit/sdk/conversation/index.js'\n\nconst client = new ConversationClient(/* configuration */)\n\nfor await (const { type, data } of client\n  .complete(null, { model: 'gpt-4', messages })\n  .stream()) {\n  if (type === 'token') {\n    process.stdout.write(data.token)\n  }\n}\n```\n\n### NextGen Example for Next.js\n\nThis example showcases how to build advanced conversational AI with streaming,\nfunction calls, server-side rendering and much more in a Next.js project:\n\n```javascript\n// file: ./app/page.jsx\nimport ChatArea from '../components/ChatArea.jsx'\n\nexport default function Page() {\n  return \u003cChatArea /\u003e\n}\n\n// file: ./components/ChatArea.jsx\n'use client'\n\nimport { useContext } from 'react'\n\nimport { complete } from '../actions/conversation.jsx'\n\nimport { ChatInput, ConversationContext } from '@chatbotkit/react'\nimport ConversationManager from '@chatbotkit/react/components/ConversationManager'\n\nexport function ChatMessages() {\n  const {\n    thinking,\n\n    text,\n    setText,\n\n    messages,\n\n    submit,\n  } = useContext(ConversationContext)\n\n  return (\n    \u003cdiv\u003e\n      \u003cdiv\u003e\n        {messages.map(({ id, type, text, children }) =\u003e {\n          switch (type) {\n            case 'user':\n              return (\n                \u003cdiv key={id}\u003e\n                  \u003cdiv\u003e\n                    \u003cstrong\u003euser:\u003c/strong\u003e {text}\n                  \u003c/div\u003e\n                \u003c/div\u003e\n              )\n\n            case 'bot':\n              return (\n                \u003cdiv key={id}\u003e\n                  \u003cdiv\u003e\n                    \u003cstrong\u003ebot:\u003c/strong\u003e {text}\n                  \u003c/div\u003e\n                  {children ? \u003cdiv\u003e{children}\u003c/div\u003e : null}\n                \u003c/div\u003e\n              )\n          }\n        })}\n        {thinking ? (\n          \u003cdiv key=\"thinking\"\u003e\n            \u003cstrong\u003ebot:\u003c/strong\u003e thinking...\n          \u003c/div\u003e\n        ) : null}\n      \u003c/div\u003e\n      \u003cChatInput\n        value={text}\n        onChange={(e) =\u003e setText(e.target.value)}\n        onSubmit={submit}\n        placeholder=\"Type something...\"\n        style={{\n          border: 0,\n          outline: 'none',\n          resize: 'none',\n          width: '100%',\n          marginTop: '10px',\n        }}\n      /\u003e\n    \u003c/div\u003e\n  )\n}\n\nexport default function ChatArea() {\n  return (\n    \u003cConversationManager endpoint={complete}\u003e\n      \u003cChatMessages /\u003e\n    \u003c/ConversationManager\u003e\n  )\n}\n\n// file: ./actions/conversation.jsx\n'use server'\n\nimport CalendarEvents from '../components/CalendarEvents.jsx'\n\nimport { streamComplete } from '@chatbotkit/react/actions/complete'\nimport { ChatBotKit } from '@chatbotkit/sdk'\n\nconst cbk = new ChatBotKit({\n  secret: process.env.CHATBOTKIT_API_SECRET,\n})\n\nexport async function complete({ messages }) {\n  return streamComplete({\n    client: cbk.conversation,\n\n    messages,\n\n    functions: [\n      {\n        name: 'getUserName',\n        description: 'Get the authenticated user name',\n        parameters: {},\n        handler: async () =\u003e {\n          return 'John Doe'\n        },\n      },\n\n      {\n        name: 'getCalendarEvents',\n        description: 'Get a list of calendar events',\n        parameters: {},\n        handler: async () =\u003e {\n          const events = [\n            { id: 1, title: 'Meeting with Jane Doe' },\n            { id: 2, title: 'Meeting with Jill Doe' },\n          ]\n\n          return {\n            children: \u003cCalendarEvents events={events} /\u003e,\n\n            result: {\n              events,\n            },\n          }\n        },\n      },\n\n      {\n        name: 'declineCalendarEvent',\n        description: 'Decline a calendar event',\n        parameters: {\n          type: 'object',\n          properties: {\n            id: {\n              type: 'number',\n              description: 'The ID of the event to decline',\n            },\n          },\n          required: ['id'],\n        },\n        handler: async ({ id }) =\u003e {\n          return `You have declined the event with ID ${id}`\n        },\n      },\n    ],\n  })\n}\n```\n\n### Basic Next.js Example\n\nThis quick example demonstrates how to use the SDK in a Next.js project:\n\n```javascript\n// file: ./pages/index.js\nimport { AutoTextarea, useConversationManager } from '@chatbotkit/react'\n\nexport default function Index() {\n  const {\n    thinking,\n\n    text,\n    setText,\n\n    messages,\n\n    submit,\n  } = useConversationManager({\n    endpoint: '/api/conversation/complete',\n  })\n\n  function handleOnKeyDown(event) {\n    if (event.keyCode === 13) {\n      event.preventDefault()\n\n      submit()\n    }\n  }\n\n  return (\n    \u003cdiv style={{ fontFamily: 'monospace', padding: '10px' }}\u003e\n      {messages.map(({ id, type, text }) =\u003e (\n        \u003cdiv key={id}\u003e\n          \u003cstrong\u003e{type}:\u003c/strong\u003e {text}\n        \u003c/div\u003e\n      ))}\n      {thinking \u0026\u0026 (\n        \u003cdiv key=\"thinking\"\u003e\n          \u003cstrong\u003ebot:\u003c/strong\u003e thinking...\n        \u003c/div\u003e\n      )}\n      \u003cAutoTextarea\n        value={text}\n        onChange={(e) =\u003e setText(e.target.value)}\n        onKeyDown={handleOnKeyDown}\n        placeholder=\"Type something...\"\n        style={{\n          border: 0,\n          outline: 'none',\n          resize: 'none',\n          width: '100%',\n          marginTop: '10px',\n        }}\n      /\u003e\n    \u003c/div\u003e\n  )\n}\n\n// file: ./pages/api/conversation/complete.js\nimport { ChatBotKit } from '@chatbotkit/sdk'\nimport { stream } from '@chatbotkit/next/edge'\n\nconst cbk = new ChatBotKit({\n  secret: process.env.CHATBOTKIT_API_SECRET,\n})\n\nexport default async function handler(req) {\n  const { messages } = await req.json()\n\n  return stream(cbk.conversation.complete(null, { messages }))\n}\n\nexport const config = {\n  runtime: 'edge',\n}\n```\n\n## Examples\n\nExplore a wide range of examples [here](https://github.com/chatbotkit/node-sdk/tree/main/examples).\n\nSome notable examples include:\n\n| Platform           | Example                                                                                                                                                                       | Description                                                                                                                                                                                                                                                                                                 |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Next.js            | [Authenticated Chat with Contacts](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/pages/auth-chat)                                                          | Demonstrates ChatBotKit Contacts for managing end-users with authentication. Shows how to use fingerprints to track users, enable personalized experiences, and unlock authentication management for 3rd-party integrations like Google and Microsoft.                                                      |\n| Next.js            | [Stateless Chat (App Router + RSC + Functions + Function Request)](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/app/stateless-chat-rsc-functions-request) | A stateless chatbot example, where the conversation is managed by the client and the server. This example uses the App Router and Server Actions as well AI functions with function requests. This is a powerful example to demonstrate the full capabilities of the ChatBotKit conversational AI platform. |\n| Next.js            | [Stateless Chat (App Router + RSC + Functions)](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/app/stateless-chat-rsc-functions)                            | A stateless chatbot example, where the conversation is managed by the client and the server. This example uses the App Router and Server Actions as well AI functions.                                                                                                                                      |\n| Next.js            | [Stateless Chat (App Router + RSC)](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/app/stateless-chat-rsc)                                                  | A stateless chatbot example, where the conversation is managed by the client and the server. This example uses the App Router and Server Actions.                                                                                                                                                           |\n| Next.js            | [Stateless Chat (App Router)](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/app/stateless-chat)                                                            | A stateless chatbot example, where the conversation is managed by the client. This example uses the App Router.                                                                                                                                                                                             |\n| Next.js            | [Stateless Chat](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/pages/stateless-chat)                                                                       | A stateless chatbot example, where the conversation is managed by the client.                                                                                                                                                                                                                               |\n| Next.js            | [Stateful Chat](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/pages/stateful-chat)                                                                         | A basic chatbot example, where the conversation is managed by ChatBotKit.                                                                                                                                                                                                                                   |\n| Next.js            | [NextAuth Example](https://github.com/chatbotkit/node-sdk/tree/main/examples/nextjs/pages/partner-auth)                                                                       | Shows how to combine NextAuth and ChatBotKit.                                                                                                                                                                                                                                                               |\n| Node               | [GPT4 Streaming AI chatbot](https://github.com/chatbotkit/node-sdk/tree/main/examples/sdk/gpt4-chatbot-stream.js)                                                             | A simple streaming AI chatbot example.                                                                                                                                                                                                                                                                      |\n| Cloudflare Workers | [GPT4 AI chatbot](https://github.com/chatbotkit/node-sdk/tree/main/examples/cloudflare/gpt4-stream)                                                                           | A streaming AI chatbot example for Cloudflare Workers.                                                                                                                                                                                                                                                      |\n\n## Stability\n\nAll SDK features are considered unstable unless explicitly marked as stable. Stability is indicated by the presence of a `@stable` tag in the documentation.\n\n## Documentation\n\n- **Type Documentation**: Detailed information on available types [here](https://chatbotkit.github.io/node-sdk/).\n- **LLMS.txt**: Documentation suitable for coding assistants can be found [here](https://chatbotkit.github.io/node-sdk/llms.txt).\n- **Platform Documentation**: Comprehensive guide to ChatBotKit [here](https://chatbotkit.com/docs).\n- **Platform Tutorials**: Step-by-step tutorials for ChatBotKit [here](https://chatbotkit.com/tutorials).\n\n## Contributing\n\nEncounter a bug or want to contribute? Open an issue or submit a pull request on our [official GitHub repository](https://github.com/chatbotkit/node-sdk).\n\n### Setup\n\nThe project is setup as a monorepo using pnpm and turbo build. Clone the reporitory and run the following commands to get started:\n\n```bash\npnpm install\n```\n\nTo perform type and lint checks, run:\n\n```bash\npnpm check\npnpm lint\n```\n\nTo build the project, run:\n\n```bash\npnpm build\n```\n\nTo build a specific package, run:\n\n```bash\npnpm -F @chatbotkit/${PACKAGE_NAME} build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatbotkit%2Fnode-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatbotkit%2Fnode-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatbotkit%2Fnode-sdk/lists"}