Is it safe that my Firebase API key is public?
The Firebase web apiKey is meant to be in your frontend. What actually protects your data: Security Rules, App Check, and key restrictions.
Check your live site
Run the free ShipLatch scan on your own site without leaving this page.
Uses 1 of your 3 free scans today; a site scanned in the last 24 hours answers from that scan. Passive and read-only: we only look at what any browser can see. Only check sites you own or may test.
What the free scan checks
- Leaked keys in your live JavaScript (AI, payment and cloud keys), including a Supabase
service_rolekey - Files that should never be public, like
/.envand/.git - Supabase and Firebase secrets in the browser: an
sb_secret_key, a Supabase access token or a Firebase service-account file - HTTPS and security headers (CSP, HSTS, clickjacking protection)
It only reads what any visitor's browser can see. It doesn't log in, read your tables or check App Check.
Update (Nov 2026): Firebase AI features stopped working on Nov 2? It's App Check. Here's the safe fix.
Update (Oct 2026): The Gemini API now rejects unrestricted standard Google keys, but a key whose API restrictions include the Generative Language API still works for Gemini (Gemini API key docs). Keys that Firebase creates for you have been restricted to Firebase-related APIs automatically since May 2024; keys you made yourself in the Cloud console were not changed (Firebase docs). Keep the Generative Language API off every public key. Read the update →
Yes, the apiKey in your Firebase web config is designed to be shipped to the browser. It identifies your project; it does not grant access by itself. What decides who can read and write is your Firebase Security Rules. That's the same idea as the Supabase anon key.
What actually matters
- Security Rules for Firestore, Realtime Database and Storage.
allow read, write: if true;or expired test-mode rules mean anyone can use your database. See rules open to the public. - App Check to make it harder for scripts outside your app to call your backend.
- API key restrictions in Google Cloud Console (HTTP referrers, and only the APIs you use) to limit abuse of other Google APIs billed to the project.
- Admin SDK service-account JSON is the real secret. It bypasses rules and must never be in frontend code or a public repo.
Quick check
Firebase Console → Firestore/Storage → Rules: look for if true or a request.time < timestamp.date(...) test-mode rule. Then use the Rules Playground to simulate an unauthenticated read of another user's document. It should be denied.
Review my Firebase Security Rules for Firestore, Realtime Database and Storage. Replace any open or test-mode rules with rules that require auth and scope access to request.auth.uid ownership. Confirm no service-account credentials are in client code, and list the API key restrictions I should set in Google Cloud Console.
Related: Firebase rules open to the public · Hide API keys
Scan your app free
Paste your URL. ShipLatch checks for leaked keys, exposed /.env and /.git, and flags Supabase/Firebase so you know what to lock down. The free scan finds the issues; the $29 Fix Pack gives you fix prompts written for your app and re-scans that prove each fix worked.
Want the whole pre-launch process in one place? See what's inside App Security for Vibe Coders, our $9 PDF playbook, or go straight to checkout.