@chat-adapter/web weekly downloads statistics
By chat-adapter (14 listings) · npm · AI SDKs
Web adapter for Chat SDK — browser chat UI over the AI SDK or AG-UI (TanStack AI) stream protocols
@chat-adapter/web has 115,553 recorded weekly downloads on npm, an increase of 362% over the past 30 days, ranking #623 of 3,247 tracked listings.
About @chat-adapter/web
@chat-adapter/web
npm package:
@chat-adapter/web
Web adapter for Chat SDK. Lets a chat-sdk bot serve a browser chat UI alongside Slack, Teams, Discord, etc. — the same bot.onDirectMessage(...) handler fires for every platform.
The adapter speaks the AI SDK UI message stream protocol by default, so React, Vue, and Svelte AI SDK clients work against the server endpoint. Set protocol: "ag-ui" to speak AG-UI instead, for TanStack AI and other AG-UI clients. The server has no runtime dependency on either client SDK.
Documentation: chat-sdk.dev/adapters/official/web · Guides: vercel.com/kb/chat-sdk
Installation
pnpm add @chat-adapter/web
Then install the client packages that match your UI:
| Client | Packages | Import from | protocol |
|---|---|---|---|
| AI SDK + React / Next.js | ai, @ai-sdk/react | @chat-adapter/web/react | "ai-sdk" (default) |
| AI SDK + Vue / Nuxt | ai, @ai-sdk/vue | @chat-adapter/web/vue | "ai-sdk" (default) |
| AI SDK + Svelte / SvelteKit | ai, @ai-sdk/svelte | @chat-adapter/web/svelte | "ai-sdk" (default) |
| TanStack AI | @tanstack/ai-react (or another TanStack AI framework package) | @tanstack/ai-react | "ag-ui" |
Scaffold with the CLI
To scaffold a new browser chat bot with the Web adapter preselected:
npx create-chat-sdk@latest my-bot --adapter web memory
Visit the adapters directory to see other available official and vendor-official adapters.
Quick start
Server
// lib/bot.ts
import { Chat } from "chat";
import { createWebAdapter } from "@chat-adapter/web";
import { createMemoryState } from "@chat-adapter/state-memory";
export const bot = new Chat({
userName: "mybot",
adapters: {
web: createWebAdapter({
userName: "mybot",
getUser: (req) => ({ id: getUserIdFromCookie(req) }),
}),
},
state: createMemoryState(),
});
bot.onDirectMessage(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
// app/api/chat/route.ts
import { after } from "next/server";
import { bot } from "@/lib/bot";
export async function POST(request: Request): Promise<Response> {
return bot.webhooks.web(request, {
waitUntil: (task) => after(() => task),
});
}
Client
React
// app/chat/page.tsx
"use client";
import { useChat } from "@chat-adapter/web/react";
export default function ChatPage() {
const { messages, sendMessage, status, stop } = useChat();
// Render with `ai-elements` (<Conversation>, <Message>, <PromptInput>)
// or your own components — `messages`, `sendMessage`, `status` are the
// standard `@ai-sdk/react` API.
}
Vue
<!-- components/Chat.vue -->
<script setup lang="ts">
import { useChat } from "@chat-adapter/web/vue";
const chat = useChat({ api: "/api/chat" });
</script>
<template>
<div v-for="msg in chat.messages" :key="msg.id">
<template
v-for="(part, index) in msg.parts"
:key="`${msg.id}-${part.type}-${index}`"
>
<p v-if="part.type === 'text'">{{ part.text }}</p>
</template>
</div>
</template>
Svelte
<!-- Chat.svelte -->
<script lang="ts">
import { useChat } from "@chat-adapter/web/svelte";
const chat = useChat({ api: "/api/chat" });
</script>
{#each chat.messages as msg (msg.id)}
{#each msg.parts as part, index (`${msg.id}-${part.type}-${index}`)}
{#if part.type === "text"}<p>{part.text}</p>{/if}
{/each}
{/each}
TanStack AI
Set protocol: "ag-ui" on the adapter, then point TanStack AI's useChat at the route with fetchServerSentEvents:
createWebAdapter({
userName: "mybot",
getUser: (req) => ({ id: getUserIdFromCookie(req) }),
protocol: "ag-ui",
});
// app/chat/page.tsx
"use client";
import { fetchServerSentEvents, useChat } from "@tanstack/ai-react";
export default function ChatPage() {
const { messages, sendMessage, isLoading, stop } = useChat({
connection: fetchServerSentEvents("/api/chat"),
threadId: "support-1",
});
// Text parts carry their text in `part.content`.
}
threadId becomes the conversation id in the chat-sdk thread id. Each thread.post call arrives as its own assistant message, and handler errors end the run with a RUN_ERROR event.
Authentication
getUser is the security boundary for the Web adapter. Unlike Slack/Teams where the platform signs every webhook, web requests come straight from a browser — you must identify the caller yourself. Returning null causes the adapter to respond with HTTP 401 and no handler runs.
Plug in whatever your app already uses:
// NextAuth
createWebAdapter({
userName: "mybot",
getUser: async (req) => {
const session = await getServerSession(authOptions);
if (!session?.user) return null;
return { id: session.user.id, name: session.user.name };
},
});
// Clerk
createWebAdapter({
userName: "mybot",
getUser: async (req) => {
const { userId, sessionClaims } = await auth();
if (!userId) return null;
return { id: userId, name: sessionClaims?.name as string | undefined };
},
});…
Description from the npm listing.
- chat
- chat-sdk
- chatbot
- web
- react
- vue
- svelte
- useChat
- ai-sdk
- ag-ui
- tanstack-ai
- ai-agent
- bot
- adapter
- vercel
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm AI SDKs plugins
All 20 @chat-adapter/web alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@chat-adapter/web. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.