Skip to content

Configuration Reference

All values are strings. Boolean switches use true unless noted.

What most people need

  • Always: Better Auth secret/base URL, app and short-link hostnames, fresh D1 and KV bindings, and their IDs
  • For analytics: ANALYTICS binding + NUXT_CF_ACCOUNT_ID + NUXT_CF_API_TOKEN — see Analytics
  • Everything else is optional

Where to put variables

Think of two moments:

WhenMeaningWorkersPages
At build timeUsed while Cloudflare builds/publishes the appWorkers Builds → VariablesSettings → Variables and Secrets
At runtimeUsed while the live app is runningWorker Settings → Variables and SecretsSame Variables and Secrets (shared)
BothNeeded in the built UI and at runtime (for example public UI settings)Set the same value in Builds and Worker settingsSet once

After changing public/build values

Trigger a new deploy so the app rebuilds. On Workers, “both” values must match in both places.

Names starting with DEPLOY_* are only for connecting resources during deploy. They rewrite placeholders in tracked wrangler.jsonc into gitignored wrangler.deploy.jsonc — set DEPLOY_* in .env or Cloudflare build variables; do not hardcode production IDs in wrangler.jsonc. Names starting with NUXT_* configure the running app.

Cloudflare bindings

A binding connects a Cloudflare product to Set under a fixed name.

BindingRequired?Plain meaning
DBYesD1 database — stores links
KVYesFast tenant-aware cache for redirects and domain resolution
ANALYTICSRecommendedVisit events for analytics
R2OptionalFile storage for backups and social images. Workers can set DEPLOY_R2_BUCKET_NAME; Pages adds R2 in the dashboard
AIOptionalWorkers AI suggestions
ASSETSAutomaticStatic files — provided for you

Analytics is optional. Without it, short links and the dashboard still work; charts stay empty. Setup: Analytics.

Required

Greenfield-only resources

This fork does not upgrade a single-tenant Set deployment. Bind fresh D1, KV, Analytics Engine, and R2 resources, then run the one-time bootstrap flow.

VariableWhenWherePurpose
NUXT_AUTH_SECRETRuntime (secret)Encrypted secret on Workers or PagesSession and token signing secret
NUXT_AUTH_BASE_URLRuntimeWorker or Pages variableExact authenticated app origin
NUXT_APP_HOSTNAMERuntimeWorker or Pages variableDashboard hostname
NUXT_SHORT_LINK_HOSTNAMESRuntimeWorker or Pages variableComma-separated configured short hosts
DEPLOY_D1_DATABASE_IDBuildWorkers Builds or Pages variablesD1 database ID (from the D1 detail page)
DEPLOY_KV_NAMESPACE_IDBuildWorkers Builds or Pages variablesKV namespace ID (from the KV detail page)
VariableWhenWherePurpose
NUXT_CF_ACCOUNT_IDRuntimeWorker or Pages variableYour Cloudflare account ID
NUXT_CF_API_TOKENRuntime (secret)Encrypted secretCustom Token with Account → Account Analytics → Read only

Also bind ANALYTICS. Add R2 for backups, AI for Workers AI. Token steps: Analytics.

Public overrides (only if you change defaults)

On Workers, set the same value in Builds and runtime. On Pages, set once, then redeploy.

VariableDefaultPurpose
NUXT_PUBLIC_PREVIEW_MODEemptytrue = demo mode (links last 5 minutes)
NUXT_PUBLIC_SLUG_DEFAULT_LENGTH6Length of auto-generated short codes
NUXT_PUBLIC_KV_BATCH_LIMIT50Export page size; import accepts at most half per request

Optional

Build-time options

VariableWhereWhen it turns on
NUXT_API_CORSBuilds or PagesExactly true allows browser apps on other sites to call /api/** (CORS). Login is still required
DEPLOY_R2_BUCKET_NAMEWorkers Builds onlySet to an existing R2 bucket name to attach R2 (bucket_name). Pages: add R2 under Bindings instead
DEPLOY_KV_PREVIEW_NAMESPACE_IDWorkers Builds or PagesOptional Wrangler preview_id; defaults to DEPLOY_KV_NAMESPACE_ID
DEPLOY_R2_PREVIEW_BUCKET_NAMEWorkers Builds onlyOptional Wrangler preview_bucket_name; defaults to DEPLOY_R2_BUCKET_NAME when R2 is enabled

Runtime options

VariablePurpose
NUXT_HOME_URLNon-empty URL redirects /; empty shows the Set homepage
NUXT_NOT_FOUND_REDIRECTWhere to send unknown short codes (always HTTP 302)
NUXT_CF_ACCESS_TEAM_DOMAIN + NUXT_CF_ACCESS_AUDBoth set → enable Cloudflare Access
NUXT_SAFE_BROWSING_DOHDNS-over-HTTPS URL used to check unsafe domains when unsafe is not set

Safe browsing example: Cloudflare Family DNS https://family.cloudflare-dns.com/dns-query. See also Link Features.

Advanced defaults (usually leave alone)

VariableDefaultPurpose
NUXT_REDIRECT_STATUS_CODE301Normal redirect code (302 / 307 / 308 also work). Unknown-slug redirects stay 302
NUXT_LINK_CACHE_TTL60How long KV caches a link (seconds)
NUXT_REDIRECT_WITH_QUERYfalsetrue appends visitor query params to the target URL
NUXT_REDIRECT_NO_STOREfalsetrue asks browsers not to cache the redirect
NUXT_CASE_SENSITIVEfalsetrue keeps custom short-code case (Docsdocs)
NUXT_DATASETsink_multitenantAnalytics dataset name; must match the ANALYTICS binding
NUXT_LIST_QUERY_LIMIT500Max rows in analytics lists
NUXT_DISABLE_BOT_ACCESS_LOGfalsetrue drops detected bots from analytics and webhooks
NUXT_DISABLE_AUTO_BACKUPfalsetrue turns off scheduled R2 backups
NUXT_AI_MODEL@cf/qwen/qwen3-30b-a3b-fp8Workers AI model
NUXT_AI_PROMPTbuilt-inCustom slug prompt must keep {slugRegex}
NUXT_AI_OG_PROMPTbuilt-inCustom social-preview prompt
DEPLOY_D1_DATABASE_NAMEsinkOverrides d1_databases[].database_name in generated deploy config
DEPLOY_ANALYTICS_DATASETsink_multitenantSets both the binding dataset and NUXT_DATASET in generated deploy config

See Analytics and API.