Production checklist
What to verify before you go live.
Work through this before you send real traffic. Each item says what breaks if
you skip it. Environment variables are validated at start-up
(server/config/env.ts); in production a missing required one fails the
build or the boot rather than running half-configured.
Keys and origins
- Project has allowed origins. In production a publishable key of a
project with an empty list is refused (
403). Add every origin that hosts your form, exactscheme://host[:port], no wildcards, no trailing slash (dashboard: project page, API keys tab). Rememberhttps://example.comandhttps://www.example.comare different origins. - Secret key is server-side only. Never in client bundles, never in a
NEXT_PUBLIC_*variable.WaitlistProviderrefusesgw_sk_keys. - Live keys, not test keys, and test keys revoked or kept out of production configuration.
- Origins are not a secret: they only protect visitors' browsers. Anyone can call the API with your publishable key from a script, which is what rate limits and abuse checks are for.
Captcha
- Create a Cloudflare Turnstile widget for your domain.
- Set
TURNSTILE_SECRET_KEYon the server (Cloudflare's always-pass test secret is for development only). - Turn on
captcha_requiredfor the waitlist, render the widget, and pass the token ascaptchaTokentojoin. - Understand the failure mode: captcha fails closed. If
TURNSTILE_SECRET_KEYis missing or Cloudflare is unreachable, joins on a captcha-required waitlist are denied. Test one real join after deploy.
Email: Resend, domain and limits
-
EMAIL_PROVIDERisresend(the production default;logis refused in production because it prints confirmation links). -
RESEND_API_KEYset. - Verify a sending domain in Resend (SPF, DKIM, and a DMARC record)
and set
EMAIL_FROMto an address on it, e.g.hello@mail.example.com. An unverified domain means confirmation emails are rejected and every signup stayspending. - Send yourself a join and click the link, end to end, on production.
- Daily caps sit under your Resend limit.
EMAIL_DAILY_CAP_FREE(default 200) andEMAIL_DAILY_CAP_PAID(default 2000) are per project per UTC day, all projects share your Resend quota. Over the cap, signups still succeed and mail is deferred to the next day with room, up to 7 days (email limits). A launch spike can therefore outrun your cap: raise it deliberately, with your provider limit in mind. - Set the waitlist's
physical_address. It prints in email footers. Optional now, required before sending promotional email. Commercial email law in many places requires a real postal address. -
redirect_urlandredirect_url_allowlistset so the confirm link lands on your site.
Cron
Emails and webhooks are sent by scheduled drains, not inside the request. Without them nothing is delivered.
-
CRON_SECRETset to 32+ random characters (openssl rand -base64 48). Without it every cron route answers401and no email or webhook is ever sent. - A scheduler calls
/api/internal/cron/drain-emailand/api/internal/cron/drain-webhooksevery minute,/api/internal/cron/drain-notificationsevery 10 minutes (owner digests and alerts), and/api/internal/cron/prune-rate-limitshourly,/api/internal/cron/prune-datadaily (retention), withAuthorization: Bearer $CRON_SECRET. On Vercel,vercel.jsonalready declares them and Vercel sends the header when the variable is namedCRON_SECRET. Per-minute schedules need a Vercel plan that allows them; elsewhere use any scheduler withcurl -X POST. - Check it works:
curl -X POST -H "Authorization: Bearer $CRON_SECRET" https://<host>/api/internal/cron/drain-emailreturns200, wrong secret returns401.
Secrets and URLs
-
APP_BASE_URLandBETTER_AUTH_URL: your publichttpsorigin, no trailing slash. Links in emails are built from it. -
IP_HASH_SECRETandBETTER_AUTH_SECRET: 32+ random characters each. ChangingIP_HASH_SECRETresets rate-limit counters. -
WEBHOOK_SECRET_KEY: 32 random bytes, base64 (openssl rand -base64 32). Rotating it makes stored webhook secrets unreadable; endpoints must be recreated. -
TRUSTED_IP_HEADERnames a header your host overwrites (x-real-ipon Vercel). If it names a header a client can set, rate limits can be bypassed. -
DATABASE_URLpoints at a managed Postgres; with a pooler use its URL.bun run db:migratehas been run against it. -
E2E_TEST_MODEunset (refused in production).
Webhooks
- Endpoint is
https, verifies signatures on the raw body, answers 2xx within 10 seconds, and deduplicates on the eventid(webhooks). - The signing secret (
whsec_...) is stored in your secret manager; it cannot be read again. - You watch for a disabled endpoint: five failed deliveries in a row disable it.
Data and compliance
- A copy path exists: webhook stream and a scheduled export (data ownership). Exports are limited to 5 per hour per key.
- Your privacy notice mentions the waitlist, referral codes, and the processors you use (privacy).
- You know your erasure procedure:
DELETEthe signup, and delete the copy in your own database.
Smoke test
After deploying, from a machine that is not yours:
curl -s https://<host>/api/v1/health
Then submit your real form from your real origin, confirm via the email, and
check the signup shows verified in the dashboard and your webhook endpoint
received signup.created and signup.verified.
Billing (Stripe)
See the launch checklist: live keys, webhook endpoint, cron, smoke test, reconcile, alerts and legal review.