firebase-admin package

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;

參數

範圍類型描述
應用程式應用程式

返回:

驗證.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服務。

返回:

實例Id.實例Id

預設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

如果未提供應用程序,則為預設的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