Secret referenced in frontend code
Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 25 points from that category, once per scan, no matter how many places it turns up.
What it detects
A frontend component/file references what looks like a secret key directly, which ships it to every browser.
Why it matters
Anything in frontend code ships to every visitor's browser, where the bundled source is one devtools click away. A secret or private key there is effectively public the moment the page loads, and scrapers do comb production bundles for exactly this. Whatever that key protects should be treated as already exposed.
How to fix it
Move the secret to the server: keep it in an environment variable read only by backend code (an API route, server component, or worker) and expose a server endpoint that performs the privileged call on behalf of the client. Delete the literal from the frontend file and rotate the key with its provider, since past builds already shipped it. Remember that NEXT_PUBLIC_ and VITE_ prefixed variables are deliberately inlined into the bundle, so secrets must never use those prefixes.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo