Documentation

Environment Setup

Set your site address and service keys, then enable only what you need

Run the project using Quick Start first. Fill in the services you want to use and leave the rest empty.

Where Settings Go

What you are settingLocallyWhen deployed
Website URL.env → VITE_APP_URLwrangler.jsonc → vars.VITE_APP_URL
Other public settings, such as analytics IDs.env.env.production or Cloudflare build variables
Authentication, AI, email, and payment secrets.dev.varsCloudflare Worker secrets
Theme, credit rewards, payment provider, and other optionsAdmin → SettingsYour live site's Admin → Settings

Settings beginning with VITE_ are visible in the browser. Put private keys only in .dev.vars or Worker secrets. To change the product name, logo, and description, use Website Settings.

1. Check Your Site Address

Open .env:

VITE_APP_URL=http://localhost:3377
VITE_ENV=development
VITE_CURRENCY=USD

When testing payments and AI locally, also set the top-level vars.VITE_APP_URL in wrangler.jsonc to http://localhost:3377.

Keep VITE_ENV=development. In this project, the value production enables waitlist mode and restricts access to docs and application pages. Keep development when opening the full site to visitors, including after launch. It does not prevent deployment to Cloudflare's production environment.

After changing configuration files, stop and restart pnpm dev.

2. Enable Registration and Admin Access

Initialize the local database, then fill in .dev.vars:

SettingValue
BETTER_AUTH_SECRETA random secret generated with the tool below
SUPER_ADMIN_EMAILThe email you will use to sign in to admin
EMAIL_PROVIDERresend
EMAIL_FROMA sender address on your verified Resend domain
RESEND_API_KEYAn API key created in Resend

Follow Authentication to register that email, click the verification link, and open admin. If the email does not arrive, check your sender domain and settings using the Email guide.

3. Choose Your Features

I want to enableSetup guide
Google or GitHub sign-inAuthentication
Subscriptions or one-time paymentsStripe or Creem; choose one
AI chat, image, video, or audio generationAI Features
File storage and reference image uploadsFile Storage
Welcome credits and credit packagesCredits
Website analyticsGoogle Analytics

Each guide lists the keys you need, where to get them, and how to test the feature.

Optional: Sign-in CAPTCHA

Create a widget in Cloudflare Turnstile and add the domains you use locally or online.

  • In .env, fill in VITE_TURNSTILE_SITE_KEY and set VITE_TURNSTILE_CAPTCHA_ENABLED=true.
  • In .dev.vars, fill in TURNSTILE_SECRET_KEY and set TURNSTILE_CAPTCHA_ENABLED=true.

Restart the site, open sign-in, and complete the CAPTCHA and login. Keep both switches set to false if you are not using CAPTCHA yet.

Change Options in Admin

Sign in as an administrator and open /admin/config. Editable options such as themes and credit rewards can be saved here. Service keys are read-only; update them in .dev.vars or your live Worker's secrets.

If a regular option is locked, the page indicates that it is controlled by an environment setting. Remove that setting and restart or redeploy to edit it in admin.

When You Go Live

Follow the deployment guide and set vars.VITE_APP_URL in wrangler.jsonc to your public HTTPS site URL. Production builds use the same setting. Keep VITE_ENV=development or leave it unset to keep all site pages accessible. No CLOUDFLARE_ENV setting is needed.

Local secrets are not uploaded automatically. Run this once for each required secret, replacing BETTER_AUTH_SECRET with its name:

pnpm exec wrangler secret put BETTER_AUTH_SECRET

Enter the value when prompted, then run pnpm run deploy. The live database and admin settings are separate from your local setup, so check each enabled feature after deployment.

On this page