Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

initializeApp

Creates and initializes a {@link @firebase/app#FirebaseApp} 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.google.com
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
const otherApp = initializeApp({
  databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
  storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
}, "otherApp");
function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
function initializeApp(): FirebaseApp;
§
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp
[src]

Creates and initializes a {@link @firebase/app#FirebaseApp} 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.google.com
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
const otherApp = initializeApp({
  databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
  storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
}, "otherApp");

§Parameters

§
  • Options to configure the app's services.
§
name?: string optional
[src]
  • Optional name of the app to initialize. If no name is provided, the default is "[DEFAULT]".

§Return Type

§

The initialized app.

§
initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp
[src]

Creates and initializes a FirebaseApp instance.

§Parameters

§
  • Options to configure the app's services.
§
config?: FirebaseAppSettings optional
[src]
  • FirebaseApp Configuration
§
initializeApp(): FirebaseApp
[src]

Creates and initializes a FirebaseApp instance.