Table of Contents
Quick Answer
Use Slack's Bolt framework with Node.js, scaffold with Claude Code, and deploy to a VPS or Socket Mode for dev. Supports slash commands, shortcuts, events, and Block Kit interactive UI.
- Time to deploy: 3-5 hours
- Cost: $0 (Socket Mode) to $5/mo (HTTP + VPS)
- Stack: Bolt JS, Node.js, Block Kit
What You'll Need
- Slack workspace with admin rights
- Node.js 20+, pnpm
- Cursor or Claude Code
- VPS or Fly.io (or Socket Mode for no hosting)
Steps
- Create the app. Go to api.slack.com/apps → Create New App → From scratch. Name it, pick workspace.
- Enable Socket Mode (easiest for dev). OAuth & Permissions → add scopes:
commands,chat:write,app_mentions:read. Socket Mode → generate App-Level Token withconnections:write. - Scaffold with AI.
pnpm add @slack/bolt dotenv. Prompt: "Create a Bolt JS app with Socket Mode. Add handlers for /ask slash command, app_mention events, and a button action using Block Kit." - Build Block Kit UI. Use Block Kit Builder. Ask AI: "Generate a Block Kit JSON with a section, divider, and two buttons for approve/reject."
- Handle interactivity. Button clicks hit
app.action('approve_btn', ...). Alwaysawait ack()within 3 seconds or Slack shows error. - Add AI responses. Route
/askto your AI backend. Stream long responses as message edits (client.chat.update). - Install to workspace. Install App → approve scopes. Token goes into your
.env. - Deploy. Socket Mode works from any laptop. For production, switch to HTTP mode, deploy to Fly.io, configure Request URL.
Common Mistakes
- Not acking within 3s: Slack retries and your handler runs multiple times.
- Blocking the event loop: Offload heavy work with
setImmediateor a queue. - Wrong scopes: Re-installation required when you add scopes.
- Ignoring retry headers: Handle
X-Slack-Retry-Numto avoid duplicate processing. - Public bot without verification: Slack requires marketplace review.
Top Tools
| Tool | Best For | Price |
|---|---|---|
| Bolt JS | Official Slack framework | Free |
| Block Kit Builder | Visual UI designer | Free |
| Socket Mode | No hosting needed | Free |
| Fly.io | Free-tier hosting | $0-5 |
| ngrok | Local HTTP dev | Free tier |
Conclusion
Slack bots automate team workflows that would otherwise cost hours. Start with Socket Mode, build one useful command, then iterate. Internal bots don't need marketplace review — ship today.
