Reference
Custom domain white-label (P12-G)
Route `https://chat.yourcompany.com` to a FluxyChat project on the Worker. Useful for embed widgets (P12-A), guest chat, and branded API endpoints without e
Route https://chat.yourcompany.com to a FluxyChat project on the Worker. Useful for embed widgets (P12-A), guest chat, and branded API endpoints without exposing the platform api.* hostname.
How it works
sequenceDiagram
participant Browser
participant CF as Cloudflare custom hostname
participant Worker
participant D1
Browser->>CF: HTTPS chat.acme.com
CF->>Worker: same Worker script
Worker->>D1: project_custom_domains hostname=chat.acme.com status=active
Worker-->>Browser: project-scoped API + CORS for chat.acme.com- Register hostname in dashboard
/custom-domains(statuspending). - Attach custom hostname in Cloudflare (for SaaS or Workers custom domain) with TLS.
- Activate domain in dashboard (
status: active) once DNS + certificate are ready. - Requests to that host resolve
projectIdfrom the hostname (no API key required). - JWTs must match the host project (
tidclaim enforced).
Operator checklist
| Step | Action |
|---|---|
| DNS / TLS | Cloudflare Custom Hostnames or Worker custom domain → same Worker |
| Worker env | WORKER_PLATFORM_HOSTS=api.fluxychat.com,fluxychat-worker.workers.dev (comma-separated platform hosts that skip white-label lookup) |
| CORS | Per-domain allowedOrigins on the domain row + auto https://\{hostname\} |
| Default room | Optional defaultRoomId for embed / guest landing |
| Guest chat | GET /public/host-config returns \{ projectId, defaultRoomId, brand \} |
API
| Method | Path | Auth | Purpose |
|---|---|---|---|
GET | /public/host-config | none | Discover project from request hostname |
GET | /admin/custom-domains | admin JWT | List domains for project |
POST | /admin/custom-domains | admin JWT | Register hostname |
PATCH | /admin/custom-domains/:id | admin JWT | Activate / disable / branding |
DELETE | /admin/custom-domains/:id | admin JWT | Remove mapping |
SDK
const config = await client.getPublicHostConfig();
const { domains } = await client.listCustomDomains();
await client.createCustomDomain({ hostname: "chat.acme.com", defaultRoomId: "support" });
await client.updateCustomDomain(id, { status: "active" });Security
- Hostname must be a valid DNS name (no
www.prefix — usechat.subdomains). - Guest sessions on a custom host only work for rooms in that project.
- Cross-tenant JWTs are rejected on white-label hosts.
Theming and data-theme (P14-I)
White-label the chat shell on your marketing site and embed iframe:
- Set
data-themeon the host page (or<html>) so your CSS can scope brand tokens:
<html lang="en" data-theme="acme">
<head>
<style>
[data-theme="acme"] {
--fluxy-primary: #0d9488;
--fluxy-surface: #f0fdfa;
--fluxy-text: #134e4a;
}
</style>
</head>-
Configure embed theme in dashboard Embed widget — saves
primaryColorand launcher position; the generated snippet includesdata-primary-coloranddata-position. -
On custom domains,
GET /public/host-configreturns optionalbrandJSON — use it to setdata-themedynamically:
const host = await client.getPublicHostConfig();
document.documentElement.setAttribute("data-theme", host.brand?.themeId ?? "default");- For full SDK embeds (not the bubble), pass the same CSS variables into your React app wrapping
@fluxy-chat/uicomponents.
Related
Browser Run (P12-K)
When `env.BROWSER` is bound, FluxyChat uses [Browser Run Quick Actions](https://developers.cloudflare.com/browser-run/quick-actions/) for richer link previews o
Daily AI digest (P12-F)
Cron-driven recap of yesterday’s chat activity: three AI-generated highlights per opted-in user, delivered via in-app notification, web push, and optional email