Fix · Vercel and deploying
A secret key appears in my live website's code
UrgentSecurityNot checked against the vendor's current screens
What you may see
- Someone says my key is visible in the page source
- I used a NEXT_PUBLIC_ or VITE_ name for a secret key
Most likely cause
Variables with the public prefix are copied into the website code that every visitor downloads.
Check first (about two minutes)
- Open the live page, view source or the network tab, and search for the start of the key.
- Find out what the key can do (read only, or can it spend money or change data?).
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- FIRST: tell me to create a new key at the service and revoke the exposed one, now (do not wait for the code fix).
- Find every variable with a public prefix and decide which are safe to be public (names of public keys only).
- Move the secret use to server code (an API route or server action) and read the key from a server-only variable.
- Redeploy, and check again that the new key is not in the page source.
Do not do this
- Do not leave the old key active "until later".
- Do not paste the key into chat to ask if it is exposed.
- Do not remove features; move the secret use to the server.