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 2 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 set to true, enables SDK to
* automatically refresh AppCheck token as needed. If false, disables this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a literal? If not, maybe just App Check here and below (but is App Check actually publicly released right now?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not a literal, can change to App Check.

We are in a code freeze right now so the release will not happen until 5/11. The documentation can be published along with the rest on 5/13, see other comment.

* functionality. This overrides any value set during `activate()`.
*/
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An AppCheck provider. This may 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
32 changes: 29 additions & 3 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1469,19 +1469,45 @@ declare namespace firebase.appCheck {
export interface AppCheck {
/**
* Activate AppCheck
* @param siteKeyOrOrovider - reCAPTCHA sitekey or custom token provider
* @param siteKeyOrProvider reCAPTCHA sitekey or custom token provider
* @param isTokenAutoRefreshEnabled If true, enables SDK to automatically
* refresh AppCheck token as needed. If undefined, the value will default
* to the value of `app.automaticDataCollectionEnabled`. That property
* defaults to false and can be set in the app config.
*/
activate(
siteKeyOrProvider: string | AppCheckProvider,
isTokenAutoRefreshEnabled?: boolean
): void;

/**
*
* @param isTokenAutoRefreshEnabled If set to true, enables SDK to
* automatically refresh AppCheck token as needed. If false, disables this
* functionality. This overrides any value set during `activate()`.
*/
activate(siteKeyOrProvider: string | AppCheckProvider): void;
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
}

/**
* An AppCheck provider. This may 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