Skip to content

Fix documentation #4875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion packages/app-check-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,35 @@ export interface FirebaseAppCheck {
siteKeyOrProvider: string | AppCheckProvider,
isTokenAutoRefreshEnabled?: boolean
): void;

/**
*
* @param isTokenAutoRefreshEnabled - If true, the SDK automatically
* refreshes App Check tokens as needed. This overrides any value set
* during `activate()`.
*/
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An App Check provider. This can be either the built-in reCAPTCHA provider
* or a custom provider. For more on custom providers, see
* https://firebase.google.com/docs/app-check/web-custom-provider
*/
interface AppCheckProvider {
/**
* returns an AppCheck token
* Returns an AppCheck token.
*/
getToken(): Promise<AppCheckToken>;
}

/**
* The token returned from an `AppCheckProvider`.
*/
interface AppCheckToken {
/**
* The token string in JWT format.
*/
readonly token: string;
/**
* The local timestamp after which the token will expire.
Expand Down
33 changes: 30 additions & 3 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1469,19 +1469,46 @@ declare namespace firebase.appCheck {
export interface AppCheck {
/**
* Activate AppCheck
* @param siteKeyOrOrovider - reCAPTCHA sitekey or custom token provider
* @param siteKeyOrProvider reCAPTCHA v3 site key (public key) or
* custom token provider.
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
* refreshes App Check tokens as needed. If undefined, defaults to the
* value of `app.automaticDataCollectionEnabled`, which defaults to
* false and can be set in the app config.
*/
activate(
siteKeyOrProvider: string | AppCheckProvider,
isTokenAutoRefreshEnabled?: boolean
): void;

/**
*
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
* refreshes App Check tokens as needed. This overrides any value set
* during `activate()`.
*/
activate(siteKeyOrProvider: string | AppCheckProvider): void;
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An App Check provider. This can be either the built-in reCAPTCHA
* provider or a custom provider. For more on custom providers, see
* https://firebase.google.com/docs/app-check/web-custom-provider
*/
interface AppCheckProvider {
/**
* returns an AppCheck token
* Returns an AppCheck token.
*/
getToken(): Promise<AppCheckToken>;
}

/**
* The token returned from an {@link firebase.appCheck.AppCheckProvider `AppCheckProvider`}.
*/
interface AppCheckToken {
/**
* The token string in JWT format.
*/
readonly token: string;
/**
* The local timestamp after which the token will expire.
Expand Down