AppCheck class
Stay organized with collections
Save and categorize content based on your preferences.
The Firebase AppCheck
service interface.
Signature:
export declare class AppCheck
Properties
Property |
Modifiers |
Type |
Description |
app |
|
App |
|
Methods
AppCheck.app
Signature:
readonly app: App;
AppCheck.createToken()
Creates a new AppCheckToken that can be sent back to a client.
Signature:
createToken(appId: string, options?: AppCheckTokenOptions): Promise<AppCheckToken>;
Parameters
Parameter |
Type |
Description |
appId |
string |
The app ID to use as the JWT app_id. |
options |
AppCheckTokenOptions |
Optional options object when creating a new App Check Token. |
Returns:
Promise<AppCheckToken>
A promise that fulfills with a AppCheckToken
.
AppCheck.verifyToken()
Verifies a Firebase App Check token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected.
Signature:
verifyToken(appCheckToken: string, options?: VerifyAppCheckTokenOptions): Promise<VerifyAppCheckTokenResponse>;
Parameters
Returns:
Promise<VerifyAppCheckTokenResponse>
A promise fulfilled with the token's decoded claims if the App Check token is valid; otherwise, a rejected promise.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-09 UTC.
[null,null,["Last updated 2023-05-09 UTC."],[],[],null,["# AppCheck class\n\nThe Firebase `AppCheck` service interface.\n\n**Signature:** \n\n export declare class AppCheck \n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------------------|-----------|------|-------------|\n| [app](./firebase-admin.app-check.appcheck.md#appcheckapp) | | App | |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|---------------------------------------------------------------------------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [createToken(appId, options)](./firebase-admin.app-check.appcheck.md#appcheckcreatetoken) | | Creates a new [AppCheckToken](./firebase-admin.app-check.appchecktoken.md#appchecktoken_interface) that can be sent back to a client. |\n| [verifyToken(appCheckToken, options)](./firebase-admin.app-check.appcheck.md#appcheckverifytoken) | | Verifies a Firebase App Check token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected. |\n\nAppCheck.app\n------------\n\n**Signature:** \n\n readonly app: App;\n\nAppCheck.createToken()\n----------------------\n\nCreates a new [AppCheckToken](./firebase-admin.app-check.appchecktoken.md#appchecktoken_interface) that can be sent back to a client.\n\n**Signature:** \n\n createToken(appId: string, options?: AppCheckTokenOptions): Promise\u003cAppCheckToken\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n| appId | string | The app ID to use as the JWT app_id. |\n| options | [AppCheckTokenOptions](./firebase-admin.app-check.appchecktokenoptions.md#appchecktokenoptions_interface) | Optional options object when creating a new App Check Token. |\n\n**Returns:**\n\nPromise\\\u003c[AppCheckToken](./firebase-admin.app-check.appchecktoken.md#appchecktoken_interface)\\\u003e\n\nA promise that fulfills with a `AppCheckToken`.\n\nAppCheck.verifyToken()\n----------------------\n\nVerifies a Firebase App Check token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected.\n\n**Signature:** \n\n verifyToken(appCheckToken: string, options?: VerifyAppCheckTokenOptions): Promise\u003cVerifyAppCheckTokenResponse\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|---------------|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| appCheckToken | string | The App Check token to verify. |\n| options | [VerifyAppCheckTokenOptions](./firebase-admin.app-check.verifyappchecktokenoptions.md#verifyappchecktokenoptions_interface) | Optional [VerifyAppCheckTokenOptions](./firebase-admin.app-check.verifyappchecktokenoptions.md#verifyappchecktokenoptions_interface) object when verifying an App Check Token. |\n\n**Returns:**\n\nPromise\\\u003c[VerifyAppCheckTokenResponse](./firebase-admin.app-check.verifyappchecktokenresponse.md#verifyappchecktokenresponse_interface)\\\u003e\n\nA promise fulfilled with the token's decoded claims if the App Check token is valid; otherwise, a rejected promise."]]