Shared instance holding credentials, storage, logger and crypto. All other modules take it as their first dependency.
const app = new FirebaseApp({
credentials: { /* CREDENTIALS HERE */ },
storage, // required, simple get/set persistency
logger, // optional, defaults to `console`
crypto, // optional, defaults to `globalThis.crypto`, needs `getRandomValues`
})credentials- Firebase web app credentialsstorage- storage automatically prefixed withappId, so multiple apps can share one storelogger- must implementlog,debug,warnanderrorcrypto- must implementgetRandomValuesinstallations-Installationsinstance created for this app
- Every module namespaces its own keys inside the provided storage (
push_receiver.*,analytics.*, …), so a single storage instance can be shared by all of them. - Modules validate the properties they need on construction and throw a
TypeErrorwith amissingPropertiesarray when something is missing. - Push identity config (bundleId, chrome identity, timeZone, vapidKey) is not held here: it lives in
PushReceiveroptions, since it's a push concept, not something every consumer ofFirebaseAppneeds.