VITE_ and NEXT_PUBLIC_ variables are not secret
AI tools often put API keys in variables named VITE_OPENAI_KEY or NEXT_PUBLIC_STRIPE_SECRET so the code "just works." Those prefixes tell the build to copy the value into your front-end JavaScript, which every visitor downloads. Anyone can open the browser's dev tools and read it.
Check it
Search your project for VITE_ and NEXT_PUBLIC_. Anything there that is a secret key (OpenAI, Stripe secret, a database service key) is exposed.
Fix it
- Move the secret to a server-side variable with no public prefix.
- Call the API from a server route or edge function, not the browser.
- Rotate any key that was ever public.
Paste this to your AI tool: "Find any secret keys in VITE_ or NEXT_PUBLIC_ variables, move those calls to a server route, and use server-only env vars."
The free ShipWatch scan checks your live app for leaked API keys in client code.