Chat SDK with Edgenivo Connect
Use Edgenivo Connect to manage a Chat SDK bot's platform credentials and forward supported events to its webhook. The Slack adapter requests credentials when it needs them and verifies the Connect token on forwarded events.
Start with the Chat SDK quickstart. It creates the Slack connector, attaches it to your Edgenivo project, and configures Redis. You need permission to install the Slack app in your workspace.
For an existing app, follow Connect's Chat SDK setup and the matching framework guide for the webhook route.
Install the bot dependencies if your project does not already include them:
pnpm add chat @chat-adapter/slack @chat-adapter/state-redis @vercel/connectSet SLACK_CONNECTOR to your connector UID, such as slack/my-bot, and configure REDIS_URL. Make both variables available in the environments where you run the bot.
Use the Connect helper in src/lib/bot.ts:
import { Chat } from 'chat';
import { createSlackAdapter } from '@chat-adapter/slack';
import { createRedisState } from '@chat-adapter/state-redis';
import { connectSlackAdapter } from '@vercel/connect/chat';
const connector = process.env.SLACK_CONNECTOR;
if (!connector) throw new Error('Set SLACK_CONNECTOR to your connector UID.');
export const bot = new Chat({
userName: 'my-bot',
adapters: {
slack: createSlackAdapter({ ...connectSlackAdapter(connector) }),
},
state: createRedisState(),
});
bot.onNewMention(async (thread) => {
await thread.subscribe();
await thread.post('Connected! Reply in this thread to chat.');
});
bot.onSubscribedMessage(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
The helper supplies outbound credentials and a webhook verifier. Pass incoming events to bot.webhooks.slack using the framework route from your existing bot. Keep the request body unread until the adapter receives it.
For the quickstart's /api/webhooks/slack route, attach your connector with:
vercel connect attach slack/my-bot --triggers --trigger-path /api/webhooks/slackUse your actual connector UID. With no environment flag, the connector is available to Production, Preview, and Development tokens, and its trigger sends events to the Production deployment. See Connect CLI environment options to target a Preview branch or restrict token access.
Pull Development credentials with vercel env pull .env.local for local outbound requests. A connector restricted to Production cannot be used with a Development OIDC token. Connect triggers deliver to deployed endpoints; test incoming Slack events against the configured deployment.
Deploy the bot and invite the installed app to a Slack channel. Mention it to receive Connected! Reply in this thread to chat., then reply to see an echo. This exercises both inbound event verification and outbound credential resolution.
If requests fail, check the connector UID, project link, allowed environment, and trigger path. Other platforms have different trigger support; use the capability table before changing adapters.
The Slack helper authenticates the bot as an app. An agent that reads a person's Linear issues through MCP needs a separate connector and a user subject derived from a verified application account.
Create MCP clients per user and handle OAuth consent before starting the model stream. For Slack users, establish an account link before requesting credentials on their behalf. Follow AI SDK with MCP and Connect or TanStack AI in a Chat SDK bot.
Was this helpful?