Initialization
config object: credentials
The config object provides the credentials that identify the Firebase project it is part of. The credentials are sent when interacting with Firebase services.
const firebaseConfig = {
apiKey: "....",
authDomain: ".....firebaseapp.com",
projectId: "....",
storageBucket: ".....firebasestorage.app",
messagingSenderId: "....",
appId: "....",
}
the app object
we compute and store a reference to app to provide it to services such as auth or firestore.
const app = initializeApp(firebaseConfig)
environments managed by Google: skip the config
On a server managed by Google, the admin SDK is automatically configured, so we initialize the app config-less:
const app = initializeApp() // on Google server