Repository navigation
shipped-secrets: fail the build when a server secret ends up in dist #23729
lagudafuadtosin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Put
VITE_in front of the wrong variable and your server key ends up in the JavaScript every visitor downloads.My issue was the build still works and nothing warns you. so this plugin checks your build and stops it if a secret is in there:
What it does is that it looks for the real values from your .env files and for common keys like Stripe, OpenAI and AWS.
Now, it never prints a full key, only the first and last few characters.
Using Next.js or something else? Build as usual, then run
npx shipped-secretsin the project folder.https://github.com/lagudafuadtosin/shipped-secrets
Tell me if it flags anything, so I can fix it.
All reactions