Terms & acceptable use

Daily note ·

Keep secret keys out of your browser code

Vibe-coded apps often call OpenAI, Stripe or Resend. The quick fix is to paste the secret key right into the app. That ships the key to every visitor.

Anything your front end uses can be read. Open dev tools, look at your JavaScript files, and search for "sk_" or "key". If you can find it, so can a bot. A leaked key can run up a real bill fast.

Move that call to a server function, like a Supabase Edge Function or a Next.js API route. Keep the key in an environment variable there. Never give it a NEXT_PUBLIC_ or VITE_ name, because those get sent to the browser.

If a key was ever public, rotate it today.

Not sure what is showing? Check your live app for free at vibecheck.ac.

Check my live app, free

More daily notes · RSS