Is it safe that my Firebase API key is visible?
Yes, Firebase's own documentation says the web API key is not a secret. It identifies the project. What protects your data is your Security Rules, so check those, and restrict the key to your domains.
I deleted the key from my code. Am I safe now?
No. Anyone who loaded the site before still has it, and it stays in your git history. Rotate it at the provider so the old one stops working.
Are environment variables secret?
Only the ones that stay on the server. Variables starting with NEXT_PUBLIC_, VITE_ or REACT_APP_ are written into the browser code on purpose.
How fast are leaked keys abused?
Fast. Automated scanners watch public code and websites for cloud and AI keys, and reports of abuse within minutes of a public push are common. Treat a leaked key as already used.