Getting Started
This guide will walk you through installing Chat SDK and creating your first bot.Installation
Install platform adapters
Install adapters for the platforms you want to support:
You only need to install adapters for platforms you plan to use. Each adapter is a separate package:
@chat-adapter/slack- Slack@chat-adapter/teams- Microsoft Teams@chat-adapter/gchat- Google Chat@chat-adapter/discord- Discord@chat-adapter/telegram- Telegram@chat-adapter/github- GitHub@chat-adapter/linear- Linear
Quick Start
Create Your Bot
Create a new filebot.ts and initialize your bot:
bot.ts
Environment Variables
Configure your platform credentials via environment variables:.env
Adapter constructors automatically read credentials from environment variables. You can also pass them explicitly as options.
Set Up Webhook Handlers
Create webhook endpoints for each platform. Here’s an example using Next.js App Router:app/api/webhooks/slack/route.ts
The
waitUntil option ensures webhook responses are fast (< 3 seconds) while message processing continues in the background. This is critical for platforms like Slack that retry if responses are slow.Platform Configuration
Each platform requires specific configuration:Slack
- Create a Slack app at api.slack.com/apps
- Enable Socket Mode or configure Event Subscriptions
- Add bot scopes:
app_mentions:read,chat:write,channels:history - Set your webhook URL to
https://your-domain.com/api/webhooks/slack - Install the app to your workspace
Microsoft Teams
- Register your app in Azure AD
- Create a Teams app manifest with your bot ID
- Configure messaging endpoint:
https://your-domain.com/api/webhooks/teams - Upload the app to Teams
Verify Installation
Test your bot by:- Starting your local server
- Using a tool like ngrok to expose your localhost
- Configuring your platform webhook URL to the ngrok URL
- @mentioning your bot in a channel
Next Steps
Basic Usage
Learn core concepts and event handlers
Event Handlers
Handle mentions, messages, reactions, and more
AI Streaming
Stream LLM responses to your chat
Interactive Cards
Build rich UI with buttons and modals