FirebaseAdmin.FirebaseApp

This is the entry point to the Firebase Admin SDK.

Summary

It holds configuration and state common to all APIs exposed from the SDK.

Use one of the providedCreate() methods to obtain a new instance. SeeInitialize the SDK for code samples and detailed documentation.

Properties

DefaultInstance
Gets the default app instance.
Name
string
Gets the name of this app.
Options
Gets a copy of theAppOptions this app was created with.

Public static functions

Create()
Creates the default app instance with Google Application Default Credentials.
Create(string name)
Creates an app with the specified name, and Google Application Default Credentials.
Create(AppOptions options)
Creates the default app instance with the specified options.
Create(AppOptions options, string name)
Creates an app with the specified name and options.
GetInstance(string name)
Returns the app instance identified by the given name.

Public functions

Delete()
void
Deletes this app instance and cleans up any state associated with it.

Properties

DefaultInstance

staticFirebaseApp DefaultInstance

Gets the default app instance.

This property isnull if the default app instance doesn't yet exist.

Name

string Name

Gets the name of this app.

Options

AppOptions Options

Gets a copy of theAppOptions this app was created with.

Public static functions

Create

FirebaseApp Create()

Creates the default app instance with Google Application Default Credentials.

Details
Exceptions
System.ArgumentException
If the default app instance already exists.
Returns
The newly createdFirebaseApp instance.

Create

FirebaseApp Create(  string name)

Creates an app with the specified name, and Google Application Default Credentials.

Details
Exceptions
System.ArgumentException
If the default app instance already exists.
Parameters
name
Name of the app.
Returns
The newly createdFirebaseApp instance.

Create

FirebaseApp Create(AppOptions options)

Creates the default app instance with the specified options.

Details
Exceptions
System.ArgumentException
If the default app instance already exists.
Parameters
options
Options to create the app with. Must at least contain theCredential.
Returns
The newly createdFirebaseApp instance.

Create

FirebaseApp Create(AppOptions options,  string name)

Creates an app with the specified name and options.

Details
Exceptions
System.ArgumentException
If the default app instance already exists.
Parameters
options
Options to create the app with. Must at least contain theCredential.
name
Name of the app.
Returns
The newly createdFirebaseApp instance.

GetInstance

FirebaseApp GetInstance(  string name)

Returns the app instance identified by the given name.

Details
Exceptions
System.ArgumentException
If the name argument is null or empty.
Parameters
name
Name of the app to retrieve.
Returns
TheFirebaseApp instance with the specified name or null if it doesn't exist.

Public functions

Delete

void Delete()

Deletes this app instance and cleans up any state associated with it.

Once an app has been deleted, accessing any services related to it will result in an exception. If the app is already deleted, this method is a no-op.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-03-24 UTC.