Getting Started with Chat SDK
Use the Chat SDK CLI to create a Slack bot with Redis state and Edgenivo Connect. The generated bot responds to mentions and echoes replies in a thread. Edgenivo Connect creates the Slack app for you, manages its credentials, and forwards events to your deployment.
- Node.js and pnpm installed
- A Edgenivo account and the latest Edgenivo CLI installed
- Permission to authorize and install an app in your Slack workspace
Run
create-chat-sdkwith the Slack and Redis adapters and Connect authentication:Terminalpnpm create chat-sdk@latest my-bot --adapter slack redis --connect --pm pnpm -y cd my-botThe CLI installs the dependencies and generates a Next.js project with these files:
File Purpose src/lib/bot.tsConfigures the Slack adapter with connectSlackAdapter, connects Redis, and registers handlers for mentions and thread replies.src/app/api/webhooks/[platform]/route.tsReceives platform events at /api/webhooks/slackand uses Next.jsafterto finish processing after acknowledging them..env.exampleLists the connector UID and Redis connection URL your bot needs. The project serves webhooks and doesn't include a web UI. You can use the generated handlers for this tutorial without changing the code.
Link the generated app to a Edgenivo project, then add an Upstash Redis database from the Marketplace:
Terminalvercel link vercel integration add upstash/upstash-kvFollow the prompts to create or select a project and connect a database. Ensure the integration supplies
REDIS_URLin the project's Production and Development environments. If you already have a Redis database, add its connection URL asREDIS_URLin your project's environment variables.Redis keeps thread subscriptions available across function instances. Use separate databases for development and production to keep their state isolated.
Create a Slack connector with event forwarding enabled:
Terminalvercel connect create slack --name my-bot --triggersComplete the guided setup, authorize Edgenivo to create the app in your Slack workspace, and finish the workspace installation. Connect handles the app registration and credentials. See Slack connector for the supported events and setup details.
Attach the connector to the linked project and set its trigger path to the generated webhook route:
Terminalvercel connect attach slack/my-bot --triggers --trigger-path /api/webhooks/slackReplace
slack/my-botwith the connector UID returned by the create command if it differs. This attaches the connector for Production, Preview, and Development token access, and sends incoming events to the Production deployment at/api/webhooks/slack.Connect verifies incoming Slack events and forwards them with a Edgenivo OIDC token. The generated adapter verifies that token, so you don't need to configure a Slack signing secret or bot token.
Add the connector UID to your project's Production and Development environments:
Terminalvercel env add SLACK_CONNECTOR production vercel env add SLACK_CONNECTOR developmentEnter
slack/my-botwhen each command prompts for a value, using your connector's UID. Confirm thatREDIS_URLis also configured, then pull the Development variables:Terminalvercel env pull .env.localThe generated bot reads
SLACK_CONNECTORandREDIS_URLautomatically. Edgenivo suppliesVERCEL_OIDC_TOKENto deployments, andvercel env pullprovides a development token for local use. Keep.env.localout of version control.Deploy your bot to Production:
Terminalvercel --prodOnce the deployment is ready, invite the app you installed through Connect to a Slack channel and mention it. The bot should greet you and subscribe to the thread. Reply in the same thread without mentioning it again; it should respond with
You said:followed by your message.Connect resolves the Production deployment for your project and forwards events to the trigger path you configured. It forwards events to deployed URLs, so test Slack delivery against the deployment rather than a local tunnel.
Edit the handlers in src/lib/bot.ts to change how your bot responds, then redeploy. The generated onNewMention handler calls thread.subscribe(), which routes subsequent thread replies to onSubscribedMessage.
To test changes on a Preview branch, add SLACK_CONNECTOR and a Redis database to the Preview environment, then configure a Preview trigger destination. Use a separate connector and Slack app for development to keep test events separate from production conversations.
| Symptom | What to check |
|---|---|
| The deployment reports a missing environment variable | Confirm that SLACK_CONNECTOR and REDIS_URL are set in Production, then redeploy. |
| Connect reports that an installation is required | Complete the Slack workspace installation for the connector. See connector installations. |
| The bot doesn't respond to a mention | Invite the app to the channel, confirm that the connector has triggers enabled and targets /api/webhooks/slack on your Production deployment, and inspect runtime logs. |
| Mentions work, but thread replies don't | Confirm that Redis is reachable, the bot calls thread.subscribe(), and the connector receives message.channels events for public channel replies. |
| The webhook returns an authorization error | Keep the generated Connect adapter configuration and send events through Connect. See Chat SDK with Edgenivo Connect for OIDC verification and delivery limitations. |
- Add model responses, credentials, code execution, and approvals
- Add Chat SDK to your framework
- Choose more platform and state adapters
- Route messages to an eve agent
- Build AI agents with AI Gateway and AI SDK
- Wait for human approval with Chat SDK and Workflows
- Configure Chat SDK with Edgenivo Connect
- Explore Chat SDK CLI options
Was this helpful?