Wake
A quiet room hibernates. The next message wakes the object with its state intact. No idle socket bill.
Every room runs as a single Durable Object on Cloudflare: state, presence and history in one place. Humans and agents on the same WebSocket. MIT when you want it on your own account.
$pnpm add @fluxy-chat/react
Worker + Durable Objects
per room, with hibernation when quiet
D1
every message kept and queryable
@fluxy-chat/sdk · react
one WebSocket, typed events
MIT
self-host on your account, or hosted beta
A message, a cursor, a tool call: they land in the same Durable Object. The SDK replays from D1 after a reconnect. You do not keep a socket fleet alive at 3am.
A quiet room hibernates. The next message wakes the object with its state intact. No idle socket bill.
History lives in D1. After a reconnect the SDK resumes from a cursor instead of an empty screen.
Agents stream replies and tool calls on the same WebSocket as the humans. One timeline, one replay.
import { FluxyRealtimeProvider, useChat } from "@fluxy-chat/react";
function App() {
return (
<FluxyRealtimeProvider
workerUrl={process.env.NEXT_PUBLIC_FLUXYCHAT_WORKER_URL!}
publishableKey="pk_..."
>
<Room />
</FluxyRealtimeProvider>
);
}
function Room() {
const { messages, sendMessage, connectionState } = useChat({
roomId: "general",
});
}Each is the same kernel with a different scaffold. The cards stack as you scroll; open one and change the copy.
On-call and an agent that summarizes the last hour. Still chat, not PagerDuty.
The bot drafts. A human can stop the stream, deny a tool, or take the thread.
Reviewers and an agent on one timeline. Import is a JSON dump you already have.
More gallery apps in Labs.
Chat core plus eleven surfaces. Each card opens a terminal preview, then a page with the real API, the honest limit, and a way into the console.
Rooms, presence, history, and agents on one WebSocket.
Preview Live streamingWorkerBroadcast, HLS, and chat overlay on the same room.
Preview GamesWorkerMatchmaking, room ticks, and leaderboards.
Preview DevicesWorkerHTTP ingest, device shadow, and room fan-out.
Preview Real-time locationWorkerLive GPS tracks, trips, and delivery status.
PreviewPresence, fan-out, agent and replay, simulated in your browser. Move the pointer: Sam is already in the room. Click to drop a note and every client sees it, exactly what the Worker does for real.
Free includes 200,000 persisted messages, 5,000 agent invokes and 50,000 webhook deliveries per month. Agents are invokes, not seats. Hosted is beta; self-host is MIT.
Weekend plan. No card. pk_ in the browser.
Production traffic with fixed monthly limits.
Heavy rooms, agents, and webhook volume.
Self-serve Stripe checkout when the Worker has STRIPE_SECRET_KEY. If /health.paymentsEnabled is false, pick a plan in the console or email us. Cards will not charge. Full pricing.
Estimate only. Cloudflare's chat Durable Object sample was dominated by duration, not request count. We have not published idle-socket duration from a real invoice. Status and limits.
FluxyChat runs entirely on your Cloudflare account. You pay Cloudflare directly no per-seat or per-message markup from us on the self-host path.
| Plan | Monthly messages | D1 reads / day | Cost (USD) | Best for |
|---|---|---|---|---|
| Workers Free | ~3M / mo (100k req/day × 30) | 5M / day | $0 | Hobby · early beta · <1k MAU |
| Workers Paid ($5/mo) | ~300M+ / mo | 25M+ / day | $5 + usage | Growing SaaS · 1k–100k MAU |
| Self-host on your CF account | Unlimited* | Your plan limits | Your plan cost | Enterprise · cost-sensitive · compliance |
* Request and D1 rows are not Durable Object duration. Cloudflare's official chat sample billed almost entirely on duration. FluxyChat has not published idle-socket duration from an invoice. Treat this table as a request-side estimate. See Cloudflare's current pricing for live numbers. Run pnpm run check:pricing to verify your env assumptions match the published rates.
What this is, what it is not, and where the hosted beta stops.
Your backend talks to the Worker over HTTP. The browser uses @fluxy-chat/sdk to join a room, send, and render. Same product, two surfaces.
Yes. Lots of teams leave Next on Vercel or Netlify and run chat on Workers + Durable Objects. You skip the platform WebSocket limits and a second Pusher-style bill.
No. Those are support desks. FluxyChat is the room layer for chat inside your app: SDK, webhooks, agent timeline. You build the UI. Guide: /guides/in-app-chat-vs-support-desk.
For tenant-scoped in-app chat on the edge, usually yes: rooms, history, reconnect, operator tools. For generic pub/sub or SMS/WhatsApp, keep those products and use FluxyChat for the chat slice.
You can run the Worker and D1 in your Cloudflare account, read the MIT source, and control upgrades. Hosted cloud is there when you do not want to wire infra on day one.
Yes. Middleware on the edge, signed webhooks, and console pages for the boring admin work.
Cloudflare puts shared state in a Durable Object. Chat rooms are the textbook case. FluxyChat uses one Room object per room and D1 for history. Guide: /guides/durable-objects-for-chat-rooms.
tool_call and tool_result ride the same WebSocket as user messages, so you replay one timeline instead of guessing what the agent did. Streaming markdown with table buffering and code fence tracking renders cleanly during AI responses. Guide: /guides/agent-events-same-websocket-stream.
A Bridge is a row in the console. You create the Slack (or Discord, Telegram, WhatsApp, Teams) app, paste the token, and point their webhook at the Worker. Web chat is just a room. We do not ship a 14-channel helpdesk.
Model Context Protocol lets your agents consume external tool servers. FluxyChat acts as an MCP client and auto-converts tools to LLM function-calling format. Point your agent at any MCP-compatible server.
Yes. The LLM middleware pipeline supports wrapGenerate, wrapStream, and transformParams hooks. Plug in guardrails, caching, RAG injection, PII redaction, or logging on the edge before responses reach users.
Yes. WorkflowAgent persists state to D1 after each step. If the Worker restarts or you deploy a new version, the agent resumes from the last completed step.
That tutorial is the right start. FluxyChat adds JWT, D1 history, reconnect in the SDK, and a console. See /guides/after-cloudflare-chat-tutorial.
You might not need to. Edge pricing you can read, self-host on your account, no socket VPS fleet. Compare at /compare.
Run the quickstart for a JWT and first room, or read /guides if you are still picking between DIY Workers chat and a packaged layer.
No. Billable calls need your JWTs and API keys. Turn on DASHBOARD_ACCESS_MODE=ack (and optional CONSOLE_GATE_SECRET) so console routes need a one-time ack first.
Free has no card. Public rooms take a pk_. Private rooms take a member JWT minted with fc_ on the server. Hosted is beta. Self-host if procurement asks who owns D1.