-
Copy
.env.exampleto.env.localand fill in the app's Firebase/upstream values. -
Add Firebase Admin credentials for protected API routes:
- Recommended local option: download a Firebase service account JSON file, save it as
firebase-admin.local.json, and setFIREBASE_SERVICE_ACCOUNT_PATH=./firebase-admin.local.json. - Alternative local option: run
node scripts/sync-firebase-env-local.mjs path/to/service-account.jsonto writeFIREBASE_SERVICE_ACCOUNT_JSONinto.env.local. - Production/Vercel option: set
FIREBASE_SERVICE_ACCOUNT_JSONto the full service account JSON value in the deployment environment.
- Recommended local option: download a Firebase service account JSON file, save it as
-
Restart
npm run devafter changing.env.local.
The protected APIs intentionally return 503 with “Firebase Admin is not configured” when these Admin credentials are missing. That keeps deployed API routes from silently becoming public.
Before deploying, confirm Vercel has these required environment variables:
FIREBASE_SERVICE_ACCOUNT_JSONNEXT_PUBLIC_FIREBASE_*APPS_SCRIPT_URLTASK_SCRIPT_URLGOOGLE_GROUPS_SCRIPT_URLASM_*CRON_SECRET
Run npm run lint and npm run build before shipping.