app_check library

App Check: attesting that a request comes from this app.

The token is not passed around by hand. Once a provider is installed, the desktop SDK's Firestore, Database, Storage and Functions pick it up themselves — so installing a provider is most of what this library does.

Desktop has two providers and no third. App Attest, DeviceCheck and Play Integrity are stubs off iOS and Android, and none of them would mean anything on an embedded board:

Install before initDatabase and before anything else makes a request. A provider installed afterwards has missed the requests already sent.

Classes

AppCheckToken
A token and the moment it stops being valid.

Properties

hasAppCheck → bool
True when the library was built with App Check bound.
no setter

Functions

appCheckToken({bool forceRefresh = false}) → Future<AppCheckToken>
The current token, for attaching to something this library does not speak — a backend of your own.
appCheckTokenChanges() → Stream<AppCheckToken>
Tokens as they are issued, including the refreshes the SDK makes on its own.
initAppCheck() → void
Binds App Check to the app already initialized by initDatabase.
limitedUseAppCheckToken() → Future<AppCheckToken>
A token for a single use: not cached, not shared.
setAppCheckAutoRefresh(bool enabled) → void
Whether the SDK refreshes a token on its own before it expires.
useCustomAppCheckProvider(Future<AppCheckToken> supply()) → void
Installs a provider that asks supply whenever the SDK needs a token.
useDebugAppCheckProvider({String debugToken = ''}) → void
Installs the SDK's debug provider.

Exceptions / Errors

AppCheckException
An App Check operation that failed.