Chat SDK Frameworks
Chat SDK works with frameworks that handle standard Web Request and Response objects. Your framework receives the webhook, passes it to a Chat SDK adapter, and keeps the function running while your bot processes the event.
Each guide uses a Slack bot with Redis state and Edgenivo Connect for credentials and webhook delivery.
| Framework | Webhook route | Background processing |
|---|---|---|
| Next.js | App Router Route Handler | after from next/server |
| Nuxt | Nuxt 4 server API route | waitUntil from @vercel/functions |
| Hono | Hono POST handler | waitUntil from @vercel/functions |
| Nitro | Nitro 3 filesystem route | event.waitUntil |
| TanStack Start | React server route | waitUntil from @vercel/functions |
For a new Next.js bot, follow the quickstart to scaffold it with create-chat-sdk. The other guides show how to add Chat SDK to an existing framework project.
Define your Chat instance and event handlers in a server-only module. The framework route passes incoming requests to bot.webhooks.slack; Chat SDK handles verification, event parsing, and dispatching to your handlers. Keep the request body unread until it reaches the adapter.
Use a persistent state adapter to share subscriptions and locks across function instances. Keep bot credentials and database connections on the server.
Pass your framework's background-task function as the webhook handler's waitUntil option. This lets the adapter acknowledge the webhook while your event handlers continue running.
Background work is still subject to the function's maximum duration. Use Workflows for tasks that need durable execution or must wait for an external event.
Was this helpful?