• 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 firebase-admin.app#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.

    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.

    Example

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