@useatlas/chat
Unified chat interaction plugin bridging Chat SDK (vercel/chat) into the Atlas plugin system. Instead of maintaining separate per-platform plugins, this single plugin provides a bridge for Chat SDK adapters. Currently ships with Slack support; additional platforms (Teams, Discord, etc.) will be added in follow-up issues (#759–#766).
Install
bun add @useatlas/chat
Usage
import { defineConfig } from "@atlas/api/lib/config";
import { chatPlugin } from "@useatlas/chat";
export default defineConfig({
plugins: [
chatPlugin({
adapters: {
slack: {
botToken: process.env.SLACK_BOT_TOKEN!,
signingSecret: process.env.SLACK_SIGNING_SECRET!,
},
},
executeQuery: myQueryFunction,
}),
],
});
Config
adapters.slack | object? | — | Slack adapter credentials (botToken, signingSecret) |
executeQuery | function | — | Callback to run the Atlas agent on a question |
checkRateLimit | function? | — | Optional rate limiting callback |
scrubError | function? | — | Optional error scrubbing callback |
At least one adapter must be configured.
How It Works
The plugin bridges Chat SDK events to Atlas:
onNewMention — User @-mentions the bot → subscribes to thread → runs executeQuery → posts result as markdown
onSubscribedMessage — Follow-up messages in subscribed threads → runs executeQuery with conversation history → posts result
Webhook routes are mounted at /webhooks/slack (under the plugin route prefix). The Chat SDK handles platform-specific details: signature verification, event parsing, and message formatting.
Error Scrubbing
All error messages are scrubbed before sending to chat platforms. Built-in patterns redact:
- Connection strings (postgres://, mysql://, etc.)
- Stack traces and file paths
- API keys and tokens (Slack, GitHub, Bearer)
Provide a custom scrubError callback for additional scrubbing.
Architecture
This is the foundation plugin for the Chat SDK adoption (#757). Downstream issues add:
- State adapter integration with Atlas internal DB (#772)
- Platform migrations: Slack (#759), Teams (#760)
- New platforms: Discord (#761), Google Chat (#762), Telegram (#763), and more
Reference