AppCheckConfig class
Configuration for dreamic-managed Firebase App Check activation.
dreamic owns App Check activation as a first-class bootstrap capability (like
Remote Config): pass an AppCheckConfig to dreamicBootstrap and dreamic
selects the right providers (with debug fallbacks and the keyless-web guard),
activates it bounded + non-critical, and enables auto-refresh. Pass null
(the default) to skip App Check entirely — opt-in by simply providing this.
First-class config. The environment-varying inputs resolve from
AppConfigBase (dart-define → programmatic default, NOT Remote Config — App
Check activates before RC), so the common case is appCheck: const AppCheckConfig() with everything driven per flavor:
- the web reCAPTCHA site key falls back to
AppConfigBase.appCheckRecaptchaSiteKey (
APP_CHECK_RECAPTCHA_SITE_KEY) when webRecaptchaSiteKey is empty; - debug-vs-real attestation is AppConfigBase.appCheckUseDebugProviders
(
APP_CHECK_DEBUG, default: real everywhere except the emulator) — NOTkDebugMode, so a debug build can attest for real against staging/prod; - activation is gated by AppConfigBase.appCheckEnabled (
APP_CHECK_ENABLED), a per-build kill switch. The*Overridefields below remain the last-resort verbatim escape hatch.
Why never fatal: App Check is consumed LAZILY — activate() registers the
provider and schedules a token; the token is fetched on the first attested
backend call, and enforcement is server-side. Hard-blocking boot on
activation would brick the app on a transient reCAPTCHA/network hiccup for
zero security gain, so a timeout/failure is reported (so it's visible) and
boot continues; App Check then attests lazily.
Constructors
- AppCheckConfig({String webRecaptchaSiteKey = '', bool webRecaptchaEnterprise = true, WebProvider? webProviderOverride, AndroidAppCheckProvider? androidProviderOverride, AppleAppCheckProvider? appleProviderOverride, bool tokenAutoRefreshEnabled = true, Duration activationTimeout = const Duration(seconds: 8)})
-
const
Properties
- activationTimeout → Duration
-
Bound on the whole activation. On timeout/failure boot continues and the
failure is reported. Default 8s — a healthy
activate()returns near-instantly (it sets up the provider and schedules the token; it does NOT await a network token), so this only fires on a genuine stall.final - androidProviderOverride → AndroidAppCheckProvider?
-
Advanced: the Android provider. Defaults to
AndroidPlayIntegrityProvider(release) /AndroidDebugProvider(debug).final - appleProviderOverride → AppleAppCheckProvider?
-
Advanced: the Apple provider. Defaults to
AppleAppAttestWithDeviceCheckFallbackProvider(release) /AppleDebugProvider(debug).final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokenAutoRefreshEnabled → bool
-
Whether to enable automatic token refresh after activation (default true).
final
- webProviderOverride → WebProvider?
-
Advanced: a fully-built web provider, used verbatim (bypasses the key /
enterprise / debug selection).
final
- webRecaptchaEnterprise → bool
-
When dreamic builds the default web provider from webRecaptchaSiteKey, use
reCAPTCHA Enterprise (true, default) or reCAPTCHA v3 (false).
Ignored in debug or when webProviderOverride is set.
final
- webRecaptchaSiteKey → String
-
The web reCAPTCHA site key. Empty (the default) ⇒ falls back to
AppConfigBase.appCheckRecaptchaSiteKey (
APP_CHECK_RECAPTCHA_SITE_KEY); if that is also empty, web usesWebDebugProvider(dev / keyless web builds — a keyless--releaseweb build would otherwise throw "Missing required parameters: sitekey"). Ignored when webProviderOverride is set. Prefer configuring the site key via AppConfigBase per flavor and leaving this empty.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveAndroidProvider(
{bool? isDebug}) → AndroidAppCheckProvider -
The Android provider dreamic will pass to
activate.isDebugdefaults to AppConfigBase.appCheckUseDebugProviders. -
resolveAppleProvider(
{bool? isDebug}) → AppleAppCheckProvider -
The Apple provider dreamic will pass to
activate.isDebugdefaults to AppConfigBase.appCheckUseDebugProviders. -
resolveWebProvider(
{bool? isDebug}) → WebProvider -
The web provider dreamic will pass to
activate. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited