Firebase App Check.
Functions
| Function | Description |
|---|---|
| getAppCheck(app) | Gets the AppCheck service for the default app or a given app.getAppCheck() can be called with no arguments to access the default app's AppCheck service or as getAppCheck(app) to access the AppCheck service associated with a specific app. |
Classes
| Class | Description |
|---|---|
| AppCheck | The Firebase AppCheck service interface. |
| FirebaseAppCheckError | Firebase App Check error code structure. This extends FirebaseError. |
Interfaces
| Interface | Description |
|---|---|
| AppCheckToken | Interface representing an App Check token. |
| AppCheckTokenOptions | Interface representing App Check token options. |
| DecodedAppCheckToken | Interface representing a decoded Firebase App Check token, returned from the AppCheck.verifyToken() method. |
| VerifyAppCheckTokenOptions | Interface representing options for the AppCheck.verifyToken() method. |
| VerifyAppCheckTokenResponse | Interface representing a verified App Check token response. |
Variables
| Variable | Description |
|---|---|
| AppCheckErrorCode | The constant mapping for valid App Check client error codes. |
Type Aliases
| Type Alias | Description |
|---|---|
| AppCheckErrorCode | The type definition for valid App Check client error codes. |
getAppCheck(app)
Gets the AppCheck service for the default app or a given app.
getAppCheck() can be called with no arguments to access the default app's AppCheck service or as getAppCheck(app) to access the AppCheck service associated with a specific app.
Signature:
export declare function getAppCheck(app?: App): AppCheck;
Parameters
| Parameter | Type | Description |
|---|---|---|
| app | App | Optional app for which to return the AppCheck service. If not provided, the default AppCheck service 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
const defaultAppCheck = getAppCheck();
Example 2
// Get the `AppCheck` service for a given app
const otherAppCheck = getAppCheck(otherApp);
AppCheckErrorCode
The constant mapping for valid App Check client error codes.
Signature:
AppCheckErrorCode: {
readonly ABORTED: "aborted";
readonly INVALID_ARGUMENT: "invalid-argument";
readonly INVALID_CREDENTIAL: "invalid-credential";
readonly INTERNAL: "internal-error";
readonly PERMISSION_DENIED: "permission-denied";
readonly UNAUTHENTICATED: "unauthenticated";
readonly NOT_FOUND: "not-found";
readonly APP_CHECK_TOKEN_EXPIRED: "app-check-token-expired";
readonly UNKNOWN: "unknown-error";
}
AppCheckErrorCode
The type definition for valid App Check client error codes.
Signature:
export type AppCheckErrorCode = typeof AppCheckErrorCode[keyof typeof AppCheckErrorCode];