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 provided Create() methods to obtain a new instance. See Initialize the SDK for code samples and detailed documentation.

Properties

DefaultInstance
static FirebaseApp
Gets the default app instance.
Name
string
Gets the name of this app.
Options
Gets a copy of the AppOptions 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

static FirebaseApp DefaultInstance

Gets the default app instance.

This property is null 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 the AppOptions 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 created FirebaseApp 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 created FirebaseApp 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 the Credential.
Returns
The newly created FirebaseApp 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 the Credential.
name
Name of the app.
Returns
The newly created FirebaseApp 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
The FirebaseApp 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.