Cloudcore

Environment Variables

Set these in wrangler.toml under [vars] for non-secret values, or use npx wrangler secret put KEY for secrets.

Core

VariableRequiredDescription
ADMIN_TOKENYesShared secret for Bearer token API access. Use a long random string.
SETUP_TOKENRecommendedRequired during initial admin account creation. Prevents race attacks on setup.
SECURE_COOKIESRecommendedSet to "true" for production. Forces Secure flag on session cookies.
ALLOWED_ORIGINSRecommendedComma-separated allowed origins for CORS. E.g., "https://admin.example.com,https://example.com"
SESSION_SLIDING_WINDOWOptionalSet to "true" to extend active sessions automatically.

GitHub OAuth

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth app client ID
GITHUB_CLIENT_SECRETGitHub OAuth app client secret
OAUTH_CALLBACK_URLBase URL for OAuth callbacks (e.g., https://cms.example.com)

Google OAuth

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret

Email / Magic Links

VariableDescription
SMTP_HOSTSMTP server hostname
SMTP_PORTSMTP port (default: 587)
SMTP_USERSMTP username
SMTP_PASSSMTP password
SMTP_FROMSender email (e.g., noreply@example.com)
SMTP_FROM_NAMESender display name
MAGIC_LINK_BASE_URLBase URL for magic link emails (where the admin UI is hosted)
SENDGRID_API_KEYAlternative to SMTP โ€” SendGrid API key
RESEND_API_KEYAlternative to SMTP โ€” Resend API key
MAILGUN_API_KEYAlternative to SMTP โ€” Mailgun API key

Cloudflare Access

VariableDescription
CF_ACCESS_ENABLEDSet to "true" to enable Cloudflare Access login
CF_ACCESS_TEAM_DOMAINYour Cloudflare Access team domain (e.g., yourteam.cloudflareaccess.com)
CF_ACCESS_AUDApplication Audience (AUD) tag from Access settings

Cloudflare Turnstile

VariableDescription
TURNSTILE_SECRETCloudflare Turnstile secret key for bot protection on forms

Frontend environment variables

Each frontend starter uses one env var to point to the CMS API:

FrontendVariableExample
React (Vite)VITE_CMS_URLhttps://cms.example.com/api/v1
Next.jsNEXT_PUBLIC_CMS_URLhttps://cms.example.com/api/v1
AstroPUBLIC_CMS_URLhttps://cms.example.com/api/v1