Skip to main content

Cloudflare Pages

Customize for your app

FileChange?What to put
wrangler.tomlOptionalname = your Pages project name; keep pages_build_output_dir = "out"
public/_headersNoCopied into out/ on build — JSON inline headers for association files
config/site.jsonYesBrand, copy, theme
Pages Environment variables (or local .env)YesSame association + store URL vars as Configuration

wrangler.toml example

name = "my-email-link-host"
compatibility_date = "2025-01-01"
pages_build_output_dir = "out"

Env vars to set in Cloudflare (Production + Preview)

VariableExample
ANDROID_PACKAGE_NAMEcom.yourcompany.yourapp
ANDROID_SHA256_CERT_FINGERPRINTSAA:BB:CC:...
IOS_TEAM_IDABCDE12345
IOS_BUNDLE_IDcom.yourcompany.yourapp
NEXT_PUBLIC_ANDROID_STORE_URLPlay Store URL
NEXT_PUBLIC_IOS_STORE_URLApp Store URL

These must be available at build time so generate:well-known and Next can bake them into out/.

Deploy (CLI)

bun install
bun run build
bunx wrangler pages deploy out --project-name=my-email-link-host

Deploy (Git)

  1. Connect the repo in Cloudflare Pages.
  2. Build command: bun run build (install Bun in the build image if needed, or use npm/npx equivalents).
  3. Output directory: out.
  4. Add the env vars above in Settings → Environment variables.

See also Hosting overview for the shared pre-deploy checklist.