Backend as a service platforms move authorisation out of your server and into a rules file. That is a real advantage, right up until the rules are wrong, because there is no server in between to catch the mistake.
The configuration your app ships, the project identifier and the client API key, is public by design and visible in your JavaScript bundle. That is expected and is not itself the problem. The rules are the only thing standing between a visitor and your data.
The common failure is starting a project in test mode, which allows open read and write access so you can build quickly, and then shipping before tightening it. A second failure is a rule that checks only that somebody is signed in, without checking which user they are, so any authenticated account can read every record. Either way the result is a database that answers questions for anyone who asks.
