Skip to main content

White-Label Setup Guide

Deploy a fully branded instance of Cronozen under your own domain. White-label partners get their own domain, branding, landing pages, and isolated data — all powered by the Cronozen platform.

Architecture Overview

White-label domains are reverse proxies to cronozen.com. The CloudFlare Worker handles domain rewriting, SEO meta tag substitution, and GA4 tracking ID replacement. Authentication flows through Central Auth (auth.cronozen.com) with brand-specific redirect URIs.

Prerequisites

Before starting, ensure you have:
  • CloudFlare account access (API token with DNS + Workers permissions)
  • AWS CLI configured (for database access via Lambda)
  • Access to the thearound-ops repository
  • The partner’s domain registered and DNS pointed to CloudFlare

Phase 1: Database Setup

1.1 Create White-Label Agreement

Register the partner in the whitelabel_agreements table. This can be done via the Admin API or a provisioning script. Via Admin API:
This single API call creates:
  • whitelabel_agreements record (partner contract)
  • centers record (tenant)
  • center_tenant_mapping (cross-service linking)
  • unified_actors (admin account)
  • center_memberships (admin membership)

1.2 Configure Features & Branding

Update the white-label agreement with branding and feature flags:
Set public_signup_enabled: false initially. Enable only after testing the full auth flow.

Phase 2: Application Configuration

Three config files must be updated in the thearound-ops repository.

2.1 Domain Registry

File: config/domains.config.ts

2.2 Proxy Constants

File: src/lib/proxy/constants.ts Add three entries:
The rewrite policy is opt-in by default. Only segments explicitly listed in CUSTOM_DOMAIN_REWRITE_SEGMENTS are proxied. This prevents accidental exposure of internal pages on the custom domain.

2.3 Auth Client Registration

File: config/auth-clients.config.ts
Set usesCookieSharing: false for white-label domains. This ensures cookies are scoped to the brand domain only, preventing cross-domain leakage.

Phase 3: CloudFlare Setup

3.1 DNS Configuration

Add the custom domain zone to CloudFlare, then create DNS records:

3.2 CloudFlare Worker

Create a Worker that proxies requests from brand.co.kr to cronozen.com: Key Worker responsibilities:
  • Root path (/) rewrite to /{brand-slug} landing page
  • Auth paths (/auth, /login) rewrite to /{brand-slug}/login
  • Static files (/sitemap.xml, /robots.txt) served directly
  • HTMLRewriter transformations:
    • GA4 tracking ID replacement (cronozen ID -> brand ID)
    • OG/Twitter meta tag domain substitution
    • Canonical link rewrite
    • Remove noindex meta tags (enable SEO for brand domain)
  • CSP header rewrite (preserve auth.cronozen.com, replace other cronozen refs)
Wrangler configuration:
Deploy:

3.3 Legacy Domain Redirects (Optional)

If the partner has an old domain that should redirect to the new canonical domain:

Phase 4: Testing

Authentication Flow

Verification Checklist


Phase 5: SEO Configuration

Philosophy

  • Platform SEO = cronozen.com (platform features, pricing)
  • Brand SEO = brand.co.kr (customer-facing, indexed by Google)
  • Internal paths (cronozen.com/brand-slug) are noindex to prevent duplicate content

Canonical URLs

The CloudFlare Worker rewrites canonical links:

Sitemap

Each brand domain serves its own sitemap.xml via the CloudFlare Worker, containing only the public pages relevant to that brand.

White-Label API

GET /api/whitelabel//config

Retrieve partner branding and feature configuration at runtime.

Data Model


Cross-Service Integration

White-label tenants can optionally enable CMS (blog) and LMS (learning) services: Enable via center_tenant_mapping:

Troubleshooting

Common Issues