1 min read
We've published @vercel/slack-bolt
, our official adapter for deploying Slack's Bolt for JavaScript to Vercel's AI Cloud.
Bolt provides a type-safe library for responding to Slack webhook events. However, Slack's API requires a response within three seconds or users are faced with timeouts. This has made it hard to build Slack agents on traditional serverless platforms.
Our adapter uses Fluid compute’s streaming and waitUntil
to acknowledge responses within Slack’s deadline while your agent continues working in the background.
import { App } from "@slack/bolt";import { generateText } from "ai";import { VercelReceiver, createHandler } from "@vercel/slack-bolt";
const receiver = new VercelReceiver();
const app = new App({ token: process.env.SLACK_BOT_TOKEN, signingSecret: process.env.SLACK_SIGNING_SECRET, receiver, deferInitialization: true,});
// listening to Slack messagesapp.event("message", async ({ say, message }) => { const { text } = await generateText({ model: "openai/gpt-5", prompt: `Respond to the user's message: ${message.text}`, }); // responding to Slack await say(text);});
export const POST = createHandler(app, receiver);
Listen to Slack messages and respond using the AI SDK
This adapter works with any function or framework using the Web API Request object such as Hono, Nitro or Next.js.
Slack Agent Template
Deploy your Slack agent on Vercel's AI Cloud
Deploy Now
Get started with our Slack Agent Template today or visit the library on npm.