Skip to content

Configuration & environment

Every variable the CaptureFlow backend reads, where it lives, and whether you need it. Most have sensible defaults — the only hard requirement is BETTER_AUTH_SECRET.

Scopes

  • worker-var — non-secret, public; declared in apps/web/wrangler.jsonc under "vars". NEXT_PUBLIC_* are additionally inlined into the client bundle.
  • worker-secret — sensitive; set with wrangler secret put (or .dev.vars locally). Never committed.
  • binding — a Cloudflare resource binding (D1, R2, assets).
  • build (desktop) — read by the desktop recorder at build time.

Bindings (required)

BindingPurposeHow to set
DBD1 databasewrangler d1 create captureflow → paste id into wrangler.jsonc
BUCKETR2 recordings bucketwrangler r2 bucket create captureflow-recordings
ASSETSStatic-assets fetcherAuto-wired by the OpenNext build

Auth

VarRequired?ScopePurpose
BETTER_AUTH_SECRETRequiredsecretSigns Better Auth sessions. Login won't work without it.
BETTER_AUTH_URLRequired (has default)varBase URL sessions are issued/validated against.
bash
openssl rand -hex 32 | pnpm --filter @captureflow/web exec wrangler secret put BETTER_AUTH_SECRET

Site URLs & CDN (public vars)

All default to https://captureflow.xyz / https://cdn.captureflow.xyz. Change them if you use a different domain.

VarDefault
NEXT_PUBLIC_APP_WEB_SITE_URLhttps://captureflow.xyz
NEXT_PUBLIC_SHARE_SITE_URLhttps://captureflow.xyz
NEXT_PUBLIC_SNAP_SITE_URLhttps://captureflow.xyz
NEXT_PUBLIC_MARKETING_SITE_URLhttps://captureflow.xyz
R2_PUBLIC_BASE_URLhttps://cdn.captureflow.xyz
NEXT_PUBLIC_R2_PUBLIC_BASE_URLmirrors R2_PUBLIC_BASE_URL
APP_DEEP_LINK_SCHEMEcaptureflow (the captureflow:// deep link)
APP_WEB_PUBLIC_URLhttps://captureflow.xyz (invite links)

Email — Resend (optional)

Skip to disable invite emails (invite links can still be shared manually).

VarScopePurpose
RESEND_API_KEYsecretResend API key for workspace-invite emails. Unset = sends skipped.
RESEND_FROM_ADDRESSsecret/varVerified "from" address. Default CaptureFlow <hello@captureflow.xyz>.

Local development

For local dev, put secrets in apps/web/.dev.vars (see .dev.vars.example) and seed a local D1:

bash
pnpm --filter @captureflow/web db:seed:local   # apply schema snapshot to local D1
pnpm --filter @captureflow/web dev             # Next.js dev server on :3032
pnpm --filter @captureflow/web cf:preview       # build + serve the Worker locally

For the full annotated table (including desktop build vars), see DEPLOY.md.

Released under the AGPL-3.0-only license.