Chat SDK Example
This is an example Next.js app using chat.
Webhook Endpoints
/api/webhooks/slack- Slack events/api/webhooks/teams- Microsoft Teams events/api/webhooks/gchat- Google Chat events/api/webhooks/discord- Discord interaction events/api/webhooks/telegram- Telegram bot updates/api/webhooks/github- GitHub PR comment events/api/webhooks/linear- Linear issue comment events
Features
- AI Mode- Mention the bot with "AI" to enable AI assistant mode (uses Claude)
- Rich Cards - Interactive cards with buttons
- Reactions - React to bot messages and it reacts back
- DM Support- Say "DM me" to get a direct message
Configuration
Set the following environment variables to enable each platform:
Slack
SLACK_BOT_TOKEN=xoxb-... SLACK_SIGNING_SECRET=...
Microsoft Teams
TEAMS_APP_ID=... TEAMS_APP_PASSWORD=...
Google Chat
GOOGLE_CHAT_CREDENTIALS={"type":"service_account",...}Discord
DISCORD_BOT_TOKEN=... DISCORD_PUBLIC_KEY=... DISCORD_APPLICATION_ID=...
Telegram
TELEGRAM_BOT_TOKEN=... TELEGRAM_WEBHOOK_SECRET_TOKEN=...
GitHub
# PAT auth (simple) GITHUB_TOKEN=ghp_... GITHUB_WEBHOOK_SECRET=... # OR GitHub App auth (recommended) GITHUB_APP_ID=... GITHUB_PRIVATE_KEY=... GITHUB_WEBHOOK_SECRET=...
Linear
# Single-workspace LINEAR_API_KEY=lin_api_... LINEAR_WEBHOOK_SECRET=... # OR multi-tenant OAuth installs LINEAR_CLIENT_ID=... LINEAR_CLIENT_SECRET=... LINEAR_REDIRECT_URI=https://your-domain.com/api/linear/install/callback LINEAR_WEBHOOK_SECRET=...