Jump to top

appCheck

interface

The Firebase AppCheck service is available for the default app or a given app.

Example 1

Get the appCheck instance for the default app:

const appCheckForDefaultApp = firebase.appCheck();
Example 2

Get the appCheck instance for a secondary app: ˚

const otherApp = firebase.app('otherApp');
const appCheckForOtherApp = firebase.appCheck(otherApp);

Properties

app

</>

The current FirebaseApp instance for this Firebase service.

Methods

activate

</>

Activate AppCheck

activate(siteKeyOrProvider: string | AppCheckProvider, isTokenAutoRefreshEnabled?: undefined | false | true): Promise<void>;

getToken

</>

Requests Firebase App Check token. This method should only be used if you need to authorize requests to a non-Firebase backend. Requests to Firebase backend are authorized automatically if configured.

getToken(forceRefresh?: undefined | false | true): Promise<AppCheckTokenResult>;

onTokenChanged

</>

Registers a listener to changes in the token state. There can be more than one listener registered at the same time for one or more App Check instances. The listeners call back on the UI thread whenever the current token associated with this App Check instance changes.

onTokenChanged(onNext: (tokenResult: AppCheckTokenResult) => void, onError?: undefined | (error: Error) => void, onCompletion?: undefined | () => void): () => void;

setTokenAutoRefreshEnabled

</>

TODO FirebaseAppCheckTokenAutoRefreshEnabled plist entry toggle through from firebase.json

setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;