Go to console

Index

Functions

applicationDefault

  • applicationDefault(httpAgent?: Agent): Credential
  • Returns a credential created from the Google Application Default Credentials that grants admin access to Firebase services. This credential can be used in the call to admin.initializeApp().

    Google Application Default Credentials are available on any Google infrastructure, such as Google App Engine and Google Compute Engine.

    See Initialize the SDK for more details.

    example
    admin.initializeApp({
      credential: admin.credential.applicationDefault(),
      databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
    });

    Parameters

    • Optional httpAgent: Agent

      Optional HTTP Agent to be used when retrieving access tokens from Google token servers.

    Returns Credential

    A credential authenticated via Google Application Default Credentials that can be used to initialize an app.

cert

  • Returns a credential created from the provided service account that grants admin access to Firebase services. This credential can be used in the call to admin.initializeApp().

    See Initialize the SDK for more details.

    example
    // Providing a path to a service ac