Chat SDK に Web アダプターサポートが追加
本文の状態
日本語全文を表示中
詳細モードで約1分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Vercel Blog
Chat SDK が新しい Web アダプターをサポートし、サーバー上でボットを定義してブラウザベースのチャット UI やインプロダクトアシスタントを構築できるようになった。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
1 min read
May 8, 2026
新しい web adapter を使用して、Chat SDK に接続するチャット UI(ユーザーインターフェース)を構築できるようになりました。製品内アシスタントやサポートエージェント、またはその他のブラウザベースのチャット体験を構築できます。
サーバー上でボットを定義します:
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});
});
各ダイレクトメッセージを送信者にエコーバックします。
次に、事前設定された @ai-sdk/react の useChat フックを使用して、返信をブラウザにリアルタイムでストリーミングします:
app/chat/page.tsx
import { useChat } from "@chat-adapter/web/react";
const { messages, sendMessage, status } = useChat();
ボットを React コンポーネントに接続します。
始めるには Chat SDK ドキュメント を読むか、サポートされているアダプター を閲覧するか、独自のアダプターの構築方法 を学ぶことができます。
原文を表示
1 min read
May 8, 2026
You can now build chat UIs that connect to Chat SDK with the new web adapter. Build in-product assistants, support agents, or any other browser-based chat experience.
Define the bot on your server:
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}`);});Echo each direct message back to the sender
Then stream replies live to the browser with a preconfigured @ai-sdk/react useChat hook:
app/chat/page.tsx
import { useChat } from "@chat-adapter/web/react";const { messages, sendMessage, status } = useChat();Wire the bot into a React component
Read the Chat SDK documentation to get started, browse the supported adapters, or learn how to build your own.
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み