Firebase namespaced API (legacy).
Functions
| Function | Description | 
|---|---|
| app(name) | |
| appCheck(app) | Gets the AppCheck service for the default app or a given app. admin.appCheck()can be called with no arguments to access the default app'sAppCheckservice or asadmin.appCheck(app)to access theAppCheckservice associated with a specific app. | 
| auth(app) | Gets the Auth service for the default app or a given app. admin.auth()can be called with no arguments to access the default app's Auth service or asadmin.auth(app)to access the Auth service associated with a specific app. | 
| database(app) | Gets the Database service for the default app or a given app. admin.database()can be called with no arguments to access the default app'sDatabaseservice or asadmin.database(app)to access theDatabaseservice associated with a specific app.admin.databaseis also a namespace that can be used to access global constants and methods associated with theDatabaseservice. | 
| firestore(app) | |
| initializeApp(options, name) | |
| installations(app) | Gets the Installations service for the default app or a given app. admin.installations()can be called with no arguments to access the default app's Installations service or asadmin.installations(app)to access the Installations service associated with a specific app. | 
| instanceId(app) | Gets the InstanceId service for the default app or a given app. admin.instanceId()can be called with no arguments to access the default app'sInstanceIdservice or asadmin.instanceId(app)to access theInstanceIdservice associated with a specific app. | 
| machineLearning(app) | Gets the MachineLearning service for the default app or a given app. admin.machineLearning()can be called with no arguments to access the default app'sMachineLearningservice or asadmin.machineLearning(app)to access theMachineLearningservice associated with a specific app. | 
| messaging(app) | Gets the Messaging service for the default app or a given app. admin.messaging()can be called with no arguments to access the default app'sMessagingservice or asadmin.messaging(app)to access theMessagingservice associated with a specific app. | 
| projectManagement(app) | Gets the ProjectManagement service for the default app or a given app. admin.projectManagement()can be called with no arguments to access the default app'sProjectManagementservice, or asadmin.projectManagement(app)to access theProjectManagementservice associated with a specific app. | 
| remoteConfig(app) | Gets the RemoteConfig service for the default app or a given app. admin.remoteConfig()can be called with no arguments to access the default app'sRemoteConfigservice or asadmin.remoteConfig(app)to access theRemoteConfigservice associated with a specific app. | 
| securityRules(app) | Gets the SecurityRules service for the default app or a given app. admin.securityRules()can be called with no arguments to access the default app's SecurityRules service, or asadmin.securityRules(app)to access the SecurityRules service associated with a specific app. | 
| storage(app) | Gets the  service for the default app or a given app. admin.storage()can be called with no arguments to access the default app'sStorageservice or asadmin.storage(app)to access theStorageservice associated with a specific app. | 
Interfaces
| Interface | Description | 
|---|---|
| AppOptions | Available options to pass to initializeApp(). | 
| FirebaseArrayIndexError | Composite type which includes both a FirebaseErrorobject and an index which can be used to get the errored item. | 
| FirebaseError | FirebaseErroris a subclass of the standard JavaScriptErrorobject. In addition to a message string and stack trace, it contains a string code. | 
| GoogleOAuthAccessToken | Interface for Google OAuth 2.0 access tokens. | 
| ServiceAccount | 
Namespaces
| Namespace | Description | 
|---|---|
| app | |
| appCheck | |
| auth | |
| credential | |
| database | |
| firestore | |
| installations | |
| instanceId | |
| machineLearning | |
| messaging | |
| projectManagement | |
| remoteConfig | |
| securityRules | |
| storage | 
Variables
| Variable | Description | 
|---|---|
| apps | |
| SDK_VERSION | 
app(name)
Signature:
export declare function app(name?: string): app.App;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| name | string | 
Returns:
appCheck(app)
Gets the AppCheck service for the default app or a given app.
admin.appCheck() can be called with no arguments to access the default app's AppCheck service or as admin.appCheck(app) to access the AppCheck service associated with a specific app.
Signature:
export declare function appCheck(app?: App): appCheck.AppCheck;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app for which to return the AppCheckservice. If not provided, the defaultAppCheckservice is returned. | 
Returns:
The default AppCheck service if no app is provided, or the AppCheck service associated with the provided app.
Example 1
// Get the `AppCheck` service for the default app
var defaultAppCheck = admin.appCheck();
Example 2
// Get the `AppCheck` service for a given app
var otherAppCheck = admin.appCheck(otherApp);
auth(app)
Gets the Auth service for the default app or a given app.
admin.auth() can be called with no arguments to access the default app's Auth service or as admin.auth(app) to access the Auth service associated with a specific app.
Signature:
export declare function auth(app?: App): auth.Auth;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | 
Returns:
Example 1
// Get the Auth service for the default app
var defaultAuth = admin.auth();
Example 2
// Get the Auth service for a given app
var otherAuth = admin.auth(otherApp);
database(app)
Gets the Database service for the default app or a given app.
admin.database() can be called with no arguments to access the default app's Database service or as admin.database(app) to access the Database service associated with a specific app.
admin.database is also a namespace that can be used to access global constants and methods associated with the Database service.
Signature:
export declare function database(app?: App): database.Database;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | 
Returns:
The default Database service if no app is provided or the Database service associated with the provided app.
Example 1
// Get the Database service for the default app
var defaultDatabase = admin.database();
Example 2
// Get the Database service for a specific app
var otherDatabase = admin.database(app);
firestore(app)
Signature:
export declare function firestore(app?: App): _firestore.Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | 
Returns:
_firestore.Firestore
initializeApp(options, name)
Signature:
export declare function initializeApp(options?: AppOptions, name?: string): app.App;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| options | AppOptions | |
| name | string | 
Returns:
installations(app)
Gets the Installations service for the default app or a given app.
admin.installations() can be called with no arguments to access the default app's Installations service or as admin.installations(app) to access the Installations service associated with a specific app.
Signature:
export declare function installations(app?: App): installations.Installations;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app whose Installationsservice to return. If not provided, the defaultInstallationsservice is returned. | 
Returns:
The default Installations service if no app is provided or the Installations service associated with the provided app.
Example 1
// Get the Installations service for the default app
var defaultInstallations = admin.installations();
Example 2
// Get the Installations service for a given app
var otherInstallations = admin.installations(otherApp);
instanceId(app)
Gets the InstanceId service for the default app or a given app.
admin.instanceId() can be called with no arguments to access the default app's InstanceId service or as admin.instanceId(app) to access the InstanceId service associated with a specific app.
Signature:
export declare function instanceId(app?: App): instanceId.InstanceId;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app whose InstanceIdservice to return. If not provided, the defaultInstanceIdservice will be returned. | 
Returns:
The default InstanceId service if no app is provided or the InstanceId service associated with the provided app.
Example 1
// Get the Instance ID service for the default app
var defaultInstanceId = admin.instanceId();
Example 2
// Get the Instance ID service for a given app
var otherInstanceId = admin.instanceId(otherApp);
machineLearning(app)
Gets the MachineLearning service for the default app or a given app.
admin.machineLearning() can be called with no arguments to access the default app's MachineLearning service or as admin.machineLearning(app) to access the MachineLearning service associated with a specific app.
Signature:
export declare function machineLearning(app?: App): machineLearning.MachineLearning;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app whose MachineLearningservice to return. If not provided, the defaultMachineLearningservice will be returned. | 
Returns:
machineLearning.MachineLearning
The default MachineLearning service if no app is provided or the MachineLearning service associated with the provided app.
Example 1
// Get the MachineLearning service for the default app
var defaultMachineLearning = admin.machineLearning();
Example 2
// Get the MachineLearning service for a given app
var otherMachineLearning = admin.machineLearning(otherApp);
messaging(app)
Gets the Messaging service for the default app or a given app.
admin.messaging() can be called with no arguments to access the default app's Messaging service or as admin.messaging(app) to access the Messaging service associated with a specific app.
Signature:
export declare function messaging(app?: App): messaging.Messaging;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app whose Messagingservice to return. If not provided, the defaultMessagingservice will be returned. | 
Returns:
The default Messaging service if no app is provided or the Messaging service associated with the provided app.
Example 1
// Get the Messaging service for the default app
var defaultMessaging = admin.messaging();
Example 2
// Get the Messaging service for a given app
var otherMessaging = admin.messaging(otherApp);
projectManagement(app)
Gets the ProjectManagement service for the default app or a given app.
admin.projectManagement() can be called with no arguments to access the default app's ProjectManagement service, or as admin.projectManagement(app) to access the ProjectManagement service associated with a specific app.
Signature:
export declare function projectManagement(app?: App): projectManagement.ProjectManagement;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app whose ProjectManagementservice to return. If not provided, the defaultProjectManagementservice will be returned. * | 
Returns:
projectManagement.ProjectManagement
The default ProjectManagement service if no app is provided or the ProjectManagement service associated with the provided app.
Example 1
// Get the ProjectManagement service for the default app
var defaultProjectManagement = admin.projectManagement();
Example 2
// Get the ProjectManagement service for a given app
var otherProjectManagement = admin.projectManagement(otherApp);
remoteConfig(app)
Gets the RemoteConfig service for the default app or a given app.
admin.remoteConfig() can be called with no arguments to access the default app's RemoteConfig service or as admin.remoteConfig(app) to access the RemoteConfig service associated with a specific app.
Signature:
export declare function remoteConfig(app?: App): remoteConfig.RemoteConfig;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app for which to return the RemoteConfigservice. If not provided, the defaultRemoteConfigservice is returned. | 
Returns:
The default RemoteConfig service if no app is provided, or the RemoteConfig service associated with the provided app.
Example 1
// Get the `RemoteConfig` service for the default app
var defaultRemoteConfig = admin.remoteConfig();
Example 2
// Get the `RemoteConfig` service for a given app
var otherRemoteConfig = admin.remoteConfig(otherApp);
securityRules(app)
Gets the SecurityRules service for the default app or a given app.
admin.securityRules() can be called with no arguments to access the default app's SecurityRules service, or as admin.securityRules(app) to access the SecurityRules service associated with a specific app.
Signature:
export declare function securityRules(app?: App): securityRules.SecurityRules;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | Optional app to return the SecurityRulesservice for. If not provided, the defaultSecurityRulesservice is returned. | 
Returns:
The default SecurityRules service if no app is provided, or the SecurityRules service associated with the provided app.
Example 1
// Get the SecurityRules service for the default app
var defaultSecurityRules = admin.securityRules();
Example 2
// Get the SecurityRules service for a given app
var otherSecurityRules = admin.securityRules(otherApp);
storage(app)
Gets the service for the default app or a given app.
admin.storage() can be called with no arguments to access the default app's Storage service or as admin.storage(app) to access the Storage service associated with a specific app.
Signature:
export declare function storage(app?: App): storage.Storage;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | 
Returns:
Example 1
// Get the Storage service for the default app
var defaultStorage = admin.storage();
Example 2
// Get the Storage service for a given app
var otherStorage = admin.storage(otherApp);
apps
Signature:
apps: (app.App | null)[]
SDK_VERSION
Signature:
SDK_VERSION: string