I'm new to Firebase and building a React app backed by the Firebase Realtime Database.
According to the docs - you can use the reserved hosting URLs to initialize the Firebase SDK. In their words:
To initialize Firebase in your app, you need to provide your app's Firebase project configuration. If you use reserved Hosting URLs, your Firebase config is automatically pulled from your Firebase project, so you don't need to explicitly provide the object in your code.
However in their docs for the Realtime Database Initialization they say to initialize your SDK using the following code snippet:
// TODO: Replace with your project's config object
var config = {
apiKey: "apiKey",
authDomain: "projectId.firebaseapp.com",
databaseURL: "https://databaseName.firebaseio.com",
storageBucket: "bucket.appspot.com"
};
firebase.initializeApp(config);
// Get a reference to the database service
var database = firebase.database();
This looks like a config object. But if you're using the hosted URLs aren't these pulled from your Firebase project? Does anyone have an example of how to use the reserved Hosting URLs with the Realtime Database?