Firebase 命名空间 API(旧版)。
功能
功能 | 描述 |
---|---|
应用程序(名称) | |
应用程序检查(应用程序) | 获取默认应用程序或给定应用程序的AppCheck服务。可以不带参数调用admin.appCheck() 来访问默认应用程序的AppCheck 服务,或者作为admin.appCheck(app) 来访问与特定应用程序关联的AppCheck 服务。 |
授权(应用程序) | 获取默认应用程序或给定应用程序的身份验证服务。可以不带参数调用admin.auth() 来访问默认应用程序的身份验证服务,或作为admin.auth(app) 来访问与特定应用程序关联的身份验证服务。 |
数据库(应用程序) | 获取默认应用程序或给定应用程序的数据库服务。可以不带参数调用admin.database() 来访问默认应用程序的Database 服务,也可以调用admin.database(app) 来访问与特定应用程序关联的Database 服务。 admin.database 也是一个命名空间,可用于访问与Database 服务关联的全局常量和方法。 |
火库(应用程序) | |
初始化应用程序(选项,名称) | |
安装(应用程序) | 获取默认应用程序或给定应用程序的安装服务。可以不带参数调用admin.installations() 来访问默认应用程序的安装服务,或者作为admin.installations(app) 来访问与特定应用程序关联的安装服务。 |
实例ID(应用程序) | 获取默认应用程序或给定应用程序的InstanceId服务。可以不带参数调用admin.instanceId() 来访问默认应用程序的InstanceId 服务,或作为admin.instanceId(app) 来访问与特定应用程序关联的InstanceId 服务。 |
机器学习(应用程序) | 获取默认应用程序或给定应用程序的机器学习服务。可以不带参数调用admin.machineLearning() 来访问默认应用程序的MachineLearning 服务,或者作为admin.machineLearning(app) 来访问与特定应用程序关联的MachineLearning 服务。 |
消息传递(应用程序) | 获取默认应用程序或给定应用程序的消息传递服务。可以不带任何参数调用admin.messaging() 来访问默认应用程序的Messaging 服务,或者作为admin.messaging(app) 来访问与特定应用程序关联的Messaging 服务。 |
项目管理(应用程序) | 获取默认应用程序或给定应用程序的ProjectManagement服务。可以不带参数调用admin.projectManagement() 来访问默认应用程序的ProjectManagement 服务,或者作为admin.projectManagement(app) 来访问与特定应用程序关联的ProjectManagement 服务。 |
远程配置(应用程序) | 获取默认应用程序或给定应用程序的RemoteConfig服务。可以不带参数调用admin.remoteConfig() 来访问默认应用程序的RemoteConfig 服务,或者作为admin.remoteConfig(app) 来访问与特定应用程序关联的RemoteConfig 服务。 |
安全规则(应用程序) | 获取默认应用程序或给定应用程序的SecurityRules服务。可以不带参数调用admin.securityRules() 来访问默认应用程序的SecurityRules服务,或者作为admin.securityRules(app) 来访问与特定应用程序关联的SecurityRules服务。 |
存储(应用程序) | 获取默认应用程序或给定应用程序的存储服务。可以不带参数调用admin.storage() 来访问默认应用程序的Storage 服务,或者作为admin.storage(app) 来访问与特定应用程序关联的Storage 服务。 |
接口
界面 | 描述 |
---|---|
应用程序选项 | 传递给initializeApp()的可用选项。 |
FirebaseArrayIndex错误 | 复合类型,其中包含FirebaseError 对象和可用于获取错误项目的索引。 |
Firebase错误 | FirebaseError 是标准 JavaScript Error 对象的子类。除了消息字符串和堆栈跟踪之外,它还包含字符串代码。 |
GoogleOAuth访问令牌 | Google OAuth 2.0 访问令牌的接口。 |
服务帐户 |
命名空间
命名空间 | 描述 |
---|---|
应用程序 | |
应用检查 | |
授权 | |
凭据 | |
数据库 | |
火库 | |
装置 | |
实例ID | |
机器学习 | |
消息传递 | |
项目管理 | |
远程配置 | |
安全规则 | |
贮存 |
变量
多变的 | 描述 |
---|---|
应用 | |
SDK_VERSION |
应用程序()
签名:
export declare function app(name?: string): app.App;
参数
范围 | 类型 | 描述 |
---|---|---|
姓名 | 细绳 |
返回:
应用检查()
获取默认应用程序或给定应用程序的AppCheck服务。
可以不带参数调用admin.appCheck()
来访问默认应用程序的AppCheck
服务,或者作为admin.appCheck(app)
来访问与特定应用程序关联的AppCheck
服务。
签名:
export declare function appCheck(app?: App): appCheck.AppCheck;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 为其返回AppCheck 服务的可选应用程序。如果未提供,则返回默认的AppCheck 服务。 |
返回:
如果未提供应用程序,则为默认AppCheck
服务,或者与所提供的应用程序关联的AppCheck
服务。
实施例1
// Get the `AppCheck` service for the default app
var defaultAppCheck = admin.appCheck();
实施例2
// Get the `AppCheck` service for a given app
var otherAppCheck = admin.appCheck(otherApp);
授权()
获取默认应用程序或给定应用程序的身份验证服务。
可以不带参数调用admin.auth()
来访问默认应用程序的身份验证服务,或作为admin.auth(app)
来访问与特定应用程序关联的身份验证服务。
签名:
export declare function auth(app?: App): auth.Auth;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 |
返回:
实施例1
// Get the Auth service for the default app
var defaultAuth = admin.auth();
实施例2
// Get the Auth service for a given app
var otherAuth = admin.auth(otherApp);
数据库()
获取默认应用程序或给定应用程序的数据库服务。
可以不带参数调用admin.database()
来访问默认应用程序的Database
服务,也可以调用admin.database(app)
来访问与特定应用程序关联的Database
服务。
admin.database
也是一个命名空间,可用于访问与Database
服务关联的全局常量和方法。
签名:
export declare function database(app?: App): database.Database;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 |
返回:
如果未提供应用程序或与提供的应用程序关联的Database
服务,则为默认Database
服务。
实施例1
// Get the Database service for the default app
var defaultDatabase = admin.database();
实施例2
// Get the Database service for a specific app
var otherDatabase = admin.database(app);
火库()
签名:
export declare function firestore(app?: App): _firestore.Firestore;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 |
返回:
_firestore.Firestore
初始化应用程序()
签名:
export declare function initializeApp(options?: AppOptions, name?: string): app.App;
参数
范围 | 类型 | 描述 |
---|---|---|
选项 | 应用程序选项 | |
姓名 | 细绳 |
返回:
装置()
获取默认应用程序或给定应用程序的安装服务。
可以不带参数调用admin.installations()
来访问默认应用程序的安装服务,或者作为admin.installations(app)
来访问与特定应用程序关联的安装服务。
签名:
export declare function installations(app?: App): installations.Installations;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 要返回其Installations 服务的可选应用程序。如果未提供,则返回默认的Installations 服务。 |
返回:
默认Installations
服务(如果未提供应用程序)或与提供的应用程序关联的Installations
服务。
实施例1
// Get the Installations service for the default app
var defaultInstallations = admin.installations();
实施例2
// Get the Installations service for a given app
var otherInstallations = admin.installations(otherApp);
实例ID()
获取默认应用程序或给定应用程序的InstanceId服务。
可以不带参数调用admin.instanceId()
来访问默认应用程序的InstanceId
服务,或作为admin.instanceId(app)
来访问与特定应用程序关联的InstanceId
服务。
签名:
export declare function instanceId(app?: App): instanceId.InstanceId;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 要返回其InstanceId 服务的可选应用程序。如果不提供,将返回默认的InstanceId 服务。 |
返回:
默认InstanceId
服务(如果未提供应用程序)或与提供的应用程序关联的InstanceId
服务。
实施例1
// Get the Instance ID service for the default app
var defaultInstanceId = admin.instanceId();
实施例2
// Get the Instance ID service for a given app
var otherInstanceId = admin.instanceId(otherApp);
机器学习()
获取默认应用程序或给定应用程序的机器学习服务。
可以不带参数调用admin.machineLearning()
来访问默认应用程序的MachineLearning
服务,或者作为admin.machineLearning(app)
来访问与特定应用程序关联的MachineLearning
服务。
签名:
export declare function machineLearning(app?: App): machineLearning.MachineLearning;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 要返回其MachineLearning 服务的可选应用程序。如果未提供,将返回默认的MachineLearning 服务。 |
返回:
默认MachineLearning
服务(如果未提供应用程序)或与提供的应用程序关联的MachineLearning
服务。
实施例1
// Get the MachineLearning service for the default app
var defaultMachineLearning = admin.machineLearning();
实施例2
// Get the MachineLearning service for a given app
var otherMachineLearning = admin.machineLearning(otherApp);
消息传递()
获取默认应用程序或给定应用程序的消息传递服务。
可以不带任何参数调用admin.messaging()
来访问默认应用程序的Messaging
服务,或者作为admin.messaging(app)
来访问与特定应用程序关联的Messaging
服务。
签名:
export declare function messaging(app?: App): messaging.Messaging;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 返回其Messaging 服务的可选应用程序。如果未提供,将返回默认的Messaging 服务。 |
返回:
默认Messaging
服务(如果未提供应用程序)或与所提供的应用程序关联的Messaging
服务。
实施例1
// Get the Messaging service for the default app
var defaultMessaging = admin.messaging();
实施例2
// Get the Messaging service for a given app
var otherMessaging = admin.messaging(otherApp);
项目管理()
获取默认应用程序或给定应用程序的ProjectManagement服务。
可以不带参数调用admin.projectManagement()
来访问默认应用程序的ProjectManagement
服务,或者作为admin.projectManagement(app)
来访问与特定应用程序关联的ProjectManagement
服务。
签名:
export declare function projectManagement(app?: App): projectManagement.ProjectManagement;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 要返回其ProjectManagement 服务的可选应用程序。如果未提供,将返回默认的ProjectManagement 服务。 * |
返回:
如果未提供应用程序,则使用默认的ProjectManagement
服务,或者与所提供的应用程序关联的ProjectManagement
服务。
实施例1
// Get the ProjectManagement service for the default app
var defaultProjectManagement = admin.projectManagement();
实施例2
// Get the ProjectManagement service for a given app
var otherProjectManagement = admin.projectManagement(otherApp);
远程配置()
获取默认应用程序或给定应用程序的RemoteConfig服务。
可以不带参数调用admin.remoteConfig()
来访问默认应用程序的RemoteConfig
服务,或者作为admin.remoteConfig(app)
来访问与特定应用程序关联的RemoteConfig
服务。
签名:
export declare function remoteConfig(app?: App): remoteConfig.RemoteConfig;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 返回RemoteConfig 服务的可选应用程序。如果未提供,则返回默认的RemoteConfig 服务。 |
返回:
如果未提供应用程序,则为默认RemoteConfig
服务,或者与提供的应用程序关联的RemoteConfig
服务。
实施例1
// Get the `RemoteConfig` service for the default app
var defaultRemoteConfig = admin.remoteConfig();
实施例2
// Get the `RemoteConfig` service for a given app
var otherRemoteConfig = admin.remoteConfig(otherApp);
安全规则()
获取默认应用程序或给定应用程序的SecurityRules服务。
可以不带参数调用admin.securityRules()
来访问默认应用程序的SecurityRules服务,或者作为admin.securityRules(app)
来访问与特定应用程序关联的SecurityRules服务。
签名:
export declare function securityRules(app?: App): securityRules.SecurityRules;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 | 用于返回SecurityRules 服务的可选应用程序。如果未提供,则返回默认的SecurityRules 服务。 |
返回:
如果未提供应用程序,则为默认的SecurityRules
服务,或者与所提供的应用程序关联的SecurityRules
服务。
实施例1
// Get the SecurityRules service for the default app
var defaultSecurityRules = admin.securityRules();
实施例2
// Get the SecurityRules service for a given app
var otherSecurityRules = admin.securityRules(otherApp);
贮存()
获取默认应用程序或给定应用程序的存储服务。
可以不带参数调用admin.storage()
来访问默认应用程序的Storage
服务,或者作为admin.storage(app)
来访问与特定应用程序关联的Storage
服务。
签名:
export declare function storage(app?: App): storage.Storage;
参数
范围 | 类型 | 描述 |
---|---|---|
应用程序 | 应用程序 |
返回:
实施例1
// Get the Storage service for the default app
var defaultStorage = admin.storage();
实施例2
// Get the Storage service for a given app
var otherStorage = admin.storage(otherApp);
应用
签名:
apps: (app.App | null)[]
SDK_VERSION
签名:
SDK_VERSION: string