I'm quite new to Firebase in general and I have some questions which I'm not sure if they are an issue or not.
First I set up my API keys and such
<script>
firebase.initializeApp({
apiKey: '#####',
authDomain: '#####',
projectId: '####'
});
// Initialize Cloud Firestore through Firebase
var db = firebase.firestore();
</script>
And than I went and used the example given by google
<script>
var docRef = db.collection("MyTable").doc("person1");
docRef.get().then(function(doc) {
if (doc.exists) {
console.log("Document data:", doc.data());
} else {
// doc.data() will be undefined in this case
console.log("No such document!");
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
</script>
And it worked i got the stuff that I needed. Buy my main question is isn't this unsafe?
I opened the Developer Console and i inspected the scripts to see what's going on and I saw that it shows everything , my database name , the collection I'm accessing and so on.
What makes a random person just copying my code and running it on their side? Is there a fix to this is it meant to work like this?
As I said I'm new to this so maybe I'm missing something here.