Navigate

API reference

pyric/app-check

16 published symbols from pyric

Generated from the TypeScript declarations shipped at this import path.

Check behavioral conformance

Classes

CustomProvider

Implements

  • ComparableProvider

Constructors

Constructor
new CustomProvider(options: CustomProviderOptions): CustomProvider;
Parameters
ParameterType
optionsCustomProviderOptions
Returns

CustomProvider

Methods

isEqual()
isEqual(other: unknown): boolean;

Upstream compares the getToken functions by source text, so a provider rebuilt by the same factory is equal.

Parameters
ParameterType
otherunknown
Returns

boolean

Implementation of
ComparableProvider.isEqual

ReCaptchaEnterpriseProvider

Implements

  • ComparableProvider

Constructors

Constructor
new ReCaptchaEnterpriseProvider(siteKey: string): ReCaptchaEnterpriseProvider;
Parameters
ParameterType
siteKeystring
Returns

ReCaptchaEnterpriseProvider

Methods

isEqual()
isEqual(other: unknown): boolean;
Parameters
ParameterType
otherunknown
Returns

boolean

Implementation of
ComparableProvider.isEqual

ReCaptchaV3Provider

Implements

  • ComparableProvider

Constructors

Constructor
new ReCaptchaV3Provider(siteKey: string): ReCaptchaV3Provider;
Parameters
ParameterType
siteKeystring
Returns

ReCaptchaV3Provider

Methods

isEqual()
isEqual(other: unknown): boolean;
Parameters
ParameterType
otherunknown
Returns

boolean

Implementation of
ComparableProvider.isEqual

Interfaces

AppCheck

Properties

PropertyModifierType
appreadonlyFirebaseApp

AppCheckOptions

Properties

PropertyType
isTokenAutoRefreshEnabled?boolean
providerAppCheckProvider

AppCheckToken

The three attestation providers. The sandbox has no reCAPTCHA, so it never calls a reCAPTCHA provider. It calls a CustomProvider as production does when no debug token is set (state.ts); under a debug token production never calls one (capture app-check-client-debug-get-token, customProviderCalls: 0), and neither does the sandbox. isEqual decides whether a second initializeAppCheck has the same options.

initialize is called at the end of initializeAppCheck, as upstream _activate calls each provider’s (@firebase/app-check 0.11.3, line 1559). Upstream’s reCAPTCHA providers add a hidden div to document there (makeDiv, line 1133), so where there is no document, such as a Node process or a server-rendered module, they throw ReferenceError: document is not defined, debug token or not. The sandbox throws the same error. A CustomProvider needs nothing to initialize.

Properties

PropertyModifierType
expireTimeMillisreadonlynumber
tokenreadonlystring

AppCheckTokenResult

Properties

PropertyModifierType
tokenreadonlystring

CustomProviderOptions

Properties

PropertyType
getToken() => Promise<AppCheckToken>

PartialObserver

Type Parameters

Type Parameter
T

Properties

PropertyType
complete?() => void
error?(error: Error) => void
next?(value: T) => void

Type Aliases

AppCheckTokenListener()

type AppCheckTokenListener = (token: AppCheckTokenResult) => void;

Parameters

ParameterType
tokenAppCheckTokenResult

Returns

void


Unsubscribe()

type Unsubscribe = () => void;

Returns

void

Functions

getLimitedUseToken()

function getLimitedUseToken(appCheck: AppCheck): Promise<AppCheckTokenResult>;

Parameters

ParameterType
appCheckAppCheck

Returns

Promise<AppCheckTokenResult>


getToken()

function getToken(appCheck: AppCheck, forceRefresh?: boolean): Promise<AppCheckTokenResult>;

Parameters

ParameterType
appCheckAppCheck
forceRefresh?boolean

Returns

Promise<AppCheckTokenResult>


initializeAppCheck()

function initializeAppCheck(app: FirebaseApp, options: AppCheckOptions): AppCheck;

Parameters

ParameterType
appFirebaseApp
optionsAppCheckOptions

Returns

AppCheck


onTokenChanged()

function onTokenChanged(
   appCheck: AppCheck,
   onNextOrObserver:
  | AppCheckTokenListener
  | PartialObserver<AppCheckTokenResult>,
   onError?: (error: Error) => void,
   onCompletion?: () => void): Unsubscribe;

Parameters

ParameterType
appCheckAppCheck
onNextOrObserver| AppCheckTokenListener | PartialObserver<AppCheckTokenResult>
onError?(error: Error) => void
onCompletion?() => void

Returns

Unsubscribe


setTokenAutoRefreshEnabled()

function setTokenAutoRefreshEnabled(appCheck: AppCheck, isTokenAutoRefreshEnabled: boolean): void;

Parameters

ParameterType
appCheckAppCheck
isTokenAutoRefreshEnabledboolean

Returns

void