AppCheck class

The Firebase AppCheck service interface.

Signature:

export declare class AppCheck 

Properties

Property Modifiers Type Description
app App

Methods

Method Modifiers Description
createToken(appId, options) Creates a new AppCheckToken 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:

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

Parameter Type Description
appCheckToken string The App Check token to verify.
options VerifyAppCheckTokenOptions Optional VerifyAppCheckTokenOptions 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.