Open beta — Try hosted cloud · Guides · Compare · Dev.to walkthrough · npm SDK ·
· Support: fluxychat@outlook.com
Realtime that feels like serverless. Edge-native chat on Cloudflare Workers + D1 — @fluxy-chat/sdk, operator console, MIT self-host or hosted quickstart.
REST on Vercel is trivial; stateful WebSockets still push teams toward another vendor or ops stack. Fluxychat keeps rooms on Workers + Durable Objects + D1 so you can start on hosted cloud and fork later without rewriting transport.
Source: github.com/AlessandroFare/fluxychat
- Cloudflare Workers + Durable Objects for WebSocket handling and presence.
- Cloudflare D1 (SQLite edge) for messages and metadata.
- React / JS SDK (
useChat(roomId)) and lightweight UI kit. - Next.js 16 dashboard for analytics, moderation, and cost insights.
Shipped in repo (deploy separately): see open beta deploy guide.
| Area | Highlights |
|---|---|
| SDK | Outbound WS queue, heartbeat, replay on connect, delivery receipts, getFeatureFlags(), voice sendVoiceMessage, inbox/search/export APIs |
| P9–P10 | Pusher parity, web push VAPID, FCM devices, polls, blocks, supergroup shards, Sent.dm contacts + SMS OTP |
| P12 killer | Voice + transcription, AI reply suggestions, daily digest, FTS search, unified inbox, custom domains, embed widget, AI handoff, thread TL;DR, quiet hours, room export PDF/MD |
| P12 platform | AI Gateway path, Flagship feature flags, Browser Run OG preview, Workflow scheduled jobs |
| P13 telco | Inbound SMS/WA → room, outbound media in SMS, agent queue + dispositions, US SMS playbook |
Full feature docs: docs/README.md · SDK API tables: packages/sdk/README.md
apps/dashboard– Next.js 16 app: marketing/landing, operator home/, guided/onboarding, analytics, rooms, admin, billing.apps/worker– Cloudflare Worker entry (WebSocket, APIs, Durable Objects).apps/ai-agent– AI Agent Service (processes mention webhooks, calls LLM providers, posts replies).packages/sdk– TypeScript client SDK (useChat, low-level client).packages/ui– Headless, themeable chat UI components.
- Sign up (Clerk) → provisions a Worker project + admin JWT.
- Quickstart (
/onboarding) → member JWT, room, first message, optional agent. - Console → rooms, agents, webhooks, billing, analytics, GDPR tools.
Backend: your messages and metadata live on your Cloudflare Worker + D1 (multi-tenant hosted cloud or self-host).
- npm org
fluxy-chat(scope@fluxy-chat) — already created for publish. cd packages/sdk && pnpm run build && pnpm testnpm loginthennpm publish --access public(frompackages/sdk).- Consumers set
baseUrlto their Worker and mint JWTs server-side — seepackages/sdk/README.md.
@fluxychat/ui and @fluxychat/agent are workspace packages today (not published yet).
- Install dependencies:
pnpm install- Run all apps in dev mode:
pnpm dev- Individual apps:
cd apps/dashboard–pnpm devcd apps/worker–pnpm dev(viawrangler dev)cd apps/ai-agent–pnpm dev(viawrangler dev)
For the Worker, optional local secrets and toggles: copy apps/worker/.dev.vars.example to apps/worker/.dev.vars (gitignored) and fill only what you need.
Use case guides, auth cookbook, troubleshooting, and dashboard integration notes live under docs/ (see docs/README.md). HTTP surface vs SPEC.md: docs/spec-implementation-map.md.
- Docs home:
docs/README.md - Dashboard (JWT session,
/rooms,/adminwebhooks, Privacy/GDPR,useChattransport):docs/dashboard-integration.md - Distribution assets (published Dev.to, InsightScout replies):
docs/distribution/README.md
- Open beta deploy (step-by-step + env):
docs/operations/open-beta-deploy-guide.md - Deploy/rollback runbook:
RUNBOOK_DEPLOY_ROLLBACK.md - Tenant recovery drill script:
apps/worker/scripts/tenant-recovery-drill.mjs - Post-deploy smoke (health + stats):
cd apps/worker && pnpm run smoke:remote -- --base-url … --admin-jwt …(seedocs/m6-operational-checklist.md) - End-to-end HTTP smoke (auth → room → message → GDPR):
export TEST_API_KEY=fc_...thenpnpm smoke:bundledfrom repo root (scripts/smoke-test.sh; requiresbash+curl)
- Public standard for AI resources is
agents. - Legacy compatibility endpoints under
botsare still supported for existing integrations.
Use an API key to mint a project-scoped JWT for SDK/client operations:
curl -X POST "http://127.0.0.1:8787/auth/token" \
-H "Content-Type: application/json" \
-H "X-Fluxy-Api-Key: fc_your_api_key" \
-d '{
"userId": "alice",
"roles": ["admin"],
"ttlSeconds": 3600
}'Create an agent:
curl -X POST "http://127.0.0.1:8787/agents" \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Assistant",
"handle": "assistant",
"provider": "openai",
"model": "gpt-4o-mini",
"capabilities": ["chat"]
}'List agents:
curl -X GET "http://127.0.0.1:8787/agents" \
-H "Authorization: Bearer <JWT>"Invoke an agent:
curl -X POST "http://127.0.0.1:8787/agents/<agentId>/invoke" \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{
"roomId": "public-demo-room",
"content": "Give me a short summary for this room"
}'Get runs for an agent:
curl -X GET "http://127.0.0.1:8787/agents/<agentId>/runs?limit=20" \
-H "Authorization: Bearer <JWT>"Get aggregated AI usage stats:
curl -X GET "http://127.0.0.1:8787/stats/ai" \
-H "Authorization: Bearer <JWT>"Read operational counters and SLO status for a project:
curl -X GET "http://127.0.0.1:8787/stats/ops?minutes=60" \
-H "Authorization: Bearer <JWT>"
curl -X GET "http://127.0.0.1:8787/stats/slo?minutes=60" \
-H "Authorization: Bearer <JWT>"
curl -X GET "http://127.0.0.1:8787/stats/launch-kpis" \
-H "Authorization: Bearer <JWT>"Default SLO targets (overridable via env):
SLO_TARGET_REQUEST_ERROR_RATE: max request error rate (default0.01)SLO_TARGET_WEBHOOK_SUCCESS_RATE: min webhook success rate (default0.98)ALERT_DISPATCH_WEBHOOK_URL: external endpoint for automatic operational alert dispatch (deduplicated per alert event)
Basic plan enforcement is enabled by default (can be disabled in dev):
QUOTAS_ENABLED(defaulttrue)QUOTA_MESSAGES_PER_MONTH(default50000)QUOTA_AGENT_INVOKES_PER_MONTH(default1000)QUOTA_WEBHOOK_DELIVERIES_PER_MONTH(default10000)
GET /stats/costs also returns pricing guardrails computed from env assumptions:
PRICE_PER_MILLION_MESSAGES(default1)PRICE_PER_AGENT_INVOKE(default0)PRICE_PER_WEBHOOK_DELIVERY(default0)MIN_GROSS_MARGIN(default0.3)
import { FluxyChatClient, useChat } from "@fluxy-chat/sdk";
const client = new FluxyChatClient({
baseUrl: "http://127.0.0.1:8787",
userId: "alice",
token: "<JWT>",
});
// low-level REST helpers
const agents = await client.listAgents();
const runs = await client.getAgentRuns(agents[0].id);
await client.invokeAgentRest(agents[0].id, "public-demo-room", "Summarize");
// hook-level helper
const { invokeAgent, agentTyping } = useChat({
roomId: "public-demo-room",
client,
agentId: agents[0].id,
});
await invokeAgent("Draft a reply for this thread");