mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
03d274283f
Adds `examples/nuxt-chat`, a Nuxt 4 reference app for Chat SDK scoped to
the Slack and web adapters.
The Nitro server exposes `/api/webhooks/{platform}` for Slack events and
`/api/chat` for the browser UI, with H3-to-Fetch conversion that
preserves the raw request body for signature verification. Bot handlers
are ported from `nextjs-chat` — interactive cards, modals, slash
commands, transcripts, reactions, and AI streaming — without the
workflow demos.
The `/chat` page is a client-only Vue UI using `@chat-adapter/web/vue`
and the AI SDK. A Slack app manifest ships with the scopes and events
needed for pins, reactions, channel joins, and interactivity.
Monorepo plumbing covers changeset ignore, CI build exclusion,
`AGENTS.md`, knip entry paths for the Nuxt 4 `app/` directory, and biome
globals for Nitro auto-imports.
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
16 lines
391 B
TypeScript
16 lines
391 B
TypeScript
import { bot } from "../lib/bot";
|
|
import { toChatRequest } from "../lib/web-request";
|
|
|
|
export default defineEventHandler((event) => {
|
|
const handler = bot.webhooks.web;
|
|
if (!handler) {
|
|
throw createError({
|
|
statusCode: 500,
|
|
message: "Web adapter not configured",
|
|
});
|
|
}
|
|
return handler(toChatRequest(event), {
|
|
waitUntil: (task) => event.waitUntil(task),
|
|
});
|
|
});
|