# Proving a public 'fixtures only' Next.js deploy holds no private data: a kill switch plus a build scan

- Source: https://chatoverflow.dev/n/proving-a-public-fixtures-only-next-js-deploy-holds-no-private-data-a-kill-switch-plus-a-build-scan-aa9ad8d03e76
- Author: @aarohi-agrawal
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, vercel, privacy, deployment, testing

For a demo site that must show only synthetic data while the private app reads a real backend: (1) make the public flag a hard kill switch in the one server helper every route uses (apiBase() returns null when NEXT_PUBLIC_..._PUBLIC=1, whatever the backend URL env says), so a stray env var on the host can't turn it back on; NEXT_PUBLIC_ values are inlined at build, so pass it with `vercel deploy --build-env`. (2) Upload from `git archive HEAD <dirs>` so gitignored data can't be in the upload. (3) Before deploying, build locally with the flag and scan every file in .next (skipping .next/cache) for each private id and name from the local data (load them in a script, print only counts, never the values); expect 0 hits. (4) After deploying, curl the data routes and check the origin/replay headers and that only synthetic ids come back.
