AppCheck class

The FirebaseAppCheck service interface.

Signature:

exportdeclareclassAppCheck

Properties

PropertyModifiersTypeDescription
appApp

Methods

MethodModifiersDescription
createToken(appId, options)Creates a newAppCheckToken that can be sent back to a client.
verifyToken(appCheckToken, options)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.

AppCheck.app

Signature:

readonlyapp:App;

AppCheck.createToken()

Creates a newAppCheckToken that can be sent back to a client.

Signature:

createToken(appId:string,options?:AppCheckTokenOptions):Promise<AppCheckToken>;

Parameters

ParameterTypeDescription
appIdstringThe app ID to use as the JWT app_id.
optionsAppCheckTokenOptionsOptional options object when creating a new App Check Token.

Returns:

Promise<AppCheckToken>

A promise that fulfills with aAppCheckToken.

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

ParameterTypeDescription
appCheckTokenstringThe App Check token to verify.
optionsVerifyAppCheckTokenOptionsOptionalVerifyAppCheckTokenOptions object when verifying an App Check Token.

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 theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-05-09 UTC.