Stripe secret key in the shipped JavaScript
The file the browser downloads contains a Stripe secret key. Anyone who can open the app can copy it and create refunds or charges. Removing it from the project is not enough. Rotate the key in Stripe, and keep the new one on the server.
1 match in /assets/index-B7Q.js. Example: sk_live…9k2Q.
Paste into Lovable
You are editing this Lovable project. Make the smallest change that fixes the issue. Do not add features. The browser bundle contains a Stripe secret key (/assets/index-B7Q.js). 1. Remove every sk_live_, sk_test_, and rk_live_ key from client code and public env vars. 2. Create the Checkout Session on the server. The browser only receives the session URL Stripe returns. 3. Rotate the key in the Stripe dashboard now. Treat the old key as public. 4. Keep the publishable key (pk_) in the browser if you need it. Never the secret key.
Paste into Cursor
You are editing this repository in Cursor. Make the smallest change that fixes the issue. Do not add features. The browser bundle contains a Stripe secret key (/assets/index-B7Q.js). 1. Remove every sk_live_, sk_test_, and rk_live_ key from client code and public env vars. 2. Create the Checkout Session on the server. The browser only receives the session URL Stripe returns. 3. Rotate the key in the Stripe dashboard now. Treat the old key as public. 4. Keep the publishable key (pk_) in the browser if you need it. Never the secret key.