• firebase

firebase is a global namespace from which all Firebase services are accessed.

Index

Variables

SDK_VERSION

SDK_VERSION: string

The current SDK version.

apps

apps: App[]

A (read-only) array of all initialized apps.

Functions

initializeApp

  • initializeApp(options: Object, name?: string): App
  • Creates and initializes a Firebase app instance.

    See Add Firebase to your app and Initialize multiple projects for detailed documentation.

    example
    
    // Initialize default app
    // Retrieve your own options values by adding a web app on
    // https://console.firebase.g.u.00rz.com
    firebase.initializeApp({
      apiKey: "AIza....",                             // Auth / General Use
      authDomain: "YOUR_APP.firebaseapp.com",         // Auth with popup/redirect
      databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
      storageBucket: "YOUR_APP.appspot.com",          // Storage
      messagingSenderId: "123456789"                  // Cloud Messaging
    });
    example
    
    // Initialize another app
    var otherApp = firebase.initializeApp({
      databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
      storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
    }, "otherApp");

    Parameters

    • options: Object

      Options to configure the app's services.

    • Optional name: string

      Optional name of the app to initialize. If no name is provided, the default is "[DEFAULT]".

    Returns App

    The initialized app.

registerVersion

  • registerVersion(library: string, version: string, variant?: string): void
  • Registers a library's name and version for platform logging purposes.

    Parameters

    • library: string

      Name of 1p or 3p library (e.g. firestore, angularfire)

    • version: string

      Current version of that library.

    • Optional variant: string

      Bundle variant, e.g., node, rn, etc.

    Returns void