Skip to content
Dashboard

Chat SDK adds web adapter support

lib/bot.ts
import { Chat } from "chat";
import { createWebAdapter } from "@chat-adapter/web";
const bot = new Chat({
userName: "mybot",
adapters: {
web: createWebAdapter({
userName: "mybot",
getUser: (req) => ({ id: getUserIdFromCookie(req) }),
}),
},
});
bot.onDirectMessage(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});

app/chat/page.tsx
import { useChat } from "@chat-adapter/web/react";
const { messages, sendMessage, status } = useChat();

The Complete Guide to Chat SDK

Learn how Chat SDK works end-to-end: from core concepts to building your first bot to deploying it across Slack, Teams, and more.

Read the guide