4

Below code is used for initializing the firebase, which is visible to every one by inspecting the element in browser. There is a chance that people would misuse my firebase database. Is there any way to make config file invisible to public, so that even when they inspect element in browser, the code would not be visible. I have followed some of the posts regarding the same question on stack overflow, but I could not get a solution.

Below is the code snippet of config file:

var config = {
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: ""
};
firebase.initializeApp(config);
beaver
  • 17,333
  • 2
  • 40
  • 66
beginner
  • 41
  • 1
  • 2
  • These are configuration values, not credentials. They are simply needed to find your project on Google's servers, and as such is is necessary for your app to know them. Firebase has other (server-side) security measures to control access, such as the [security rules for the database](https://firebase.google.com/docs/database/security/). Also see https://stackoverflow.com/questions/37482366/is-it-safe-to-expose-firebase-apikey-to-the-public – Frank van Puffelen Dec 12 '17 at 14:49

0 Answers0