Embeddable chat for Dewee agents. Drop one tag on any site and visitors talk to your agent, with streamed reasoning, tool calls, markdown, history and agent switching. Your gateway token stays on your server.
▶ Playground: webchat.dewee.sh · npm: dewee-webchat ·
CDN: https://webchat-cdn.dewee.sh/dewee-webchat@0.1.1/dewee-webchat.js
browser <dewee-chat> ──HTTPS + SSE──▶ your backend /api/dewee/* ──WebSocket──▶ Dewee gateway
(visitor token only) (holds the gateway token) (agents, MCP, tools)
npm i dewee-webchat- Mount the backend handler at
/api/dewee/*(Workers, Next.js, Astro, Node, Bun, Deno, or the PHP file). - Set
DEWEE_GATEWAY_URL,DEWEE_GATEWAY_TOKEN,DEWEE_WEBCHAT_SECRET,DEWEE_AGENTS. See.env.example. - Add the widget:
<script src="https://webchat-cdn.dewee.sh/dewee-webchat@0.1.1/dewee-webchat.js" data-endpoint="/api/dewee" defer></script>Full options, framework snippets and the security model: packages/dewee-webchat/README.md.
All of them run on Cloudflare and share the same scoped demo key.
| Stack | Live | Source |
|---|---|---|
| Plain HTML + Worker (playground) | webchat.dewee.sh | examples/cloudflare |
| Next.js (App Router, OpenNext) | webchat-next.dewee.sh | examples/nextjs |
| Astro | webchat-astro.dewee.sh | examples/astro |
| React + Vite | webchat-react.dewee.sh | examples/react-vite |
| Vue + Vite | webchat-vue.dewee.sh | examples/vue-vite |
| Node + Express | local | examples/node-express |
| PHP (no Composer) | local | examples/php · php/ |
| Path | |
|---|---|
packages/dewee-webchat |
The npm package: web component, React/Vue/Astro wrappers, dewee-webchat/server handler |
php/dewee-webchat.php |
Single-file PHP backend with the same HTTP contract |
cdn/ |
Worker that serves versioned bundles at webchat-cdn.dewee.sh |
docs/http-contract.md |
Wire format between the widget and any backend |
examples/ |
Runnable integrations |
pnpm install
pnpm test # vitest
pnpm typecheck
pnpm build # packages/dewee-webchat/distRun the playground locally: copy examples/cloudflare/.dev.vars.example to .dev.vars, fill it in, then
pnpm -C examples/cloudflare dev.
Release: bump packages/dewee-webchat/package.json (and VERSION in php/dewee-webchat.php), commit, then
push a matching tag (git tag v0.1.2 && git push origin v0.1.2). release.yml
publishes to npm through npm Trusted Publishing (OIDC, no token) and creates the GitHub release. Then run
node cdn/scripts/build-cdn.mjs && pnpm -C examples/cloudflare exec wrangler deploy --config ../../cdn/wrangler.jsonc
to add the version to the CDN.