Skip to content

Commit 7d0f026

Browse files
committed
Fix documentation
1 parent 81c131a commit 7d0f026

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

packages/app-check-types/index.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,35 @@ export interface FirebaseAppCheck {
2828
siteKeyOrProvider: string | AppCheckProvider,
2929
isTokenAutoRefreshEnabled?: boolean
3030
): void;
31+
32+
/**
33+
*
34+
* @param isTokenAutoRefreshEnabled - If set to true, enables SDK to
35+
* automatically refresh AppCheck token as needed. If false, disables this
36+
* functionality. This overrides any value set during `activate()`.
37+
*/
3138
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
3239
}
3340

41+
/**
42+
* An AppCheck provider. This may be either the built-in reCAPTCHA provider
43+
* or a custom provider. For more on custom providers, see
44+
* https://firebase.google.com/docs/app-check/web-custom-provider
45+
*/
3446
interface AppCheckProvider {
3547
/**
36-
* returns an AppCheck token
48+
* Returns an AppCheck token.
3749
*/
3850
getToken(): Promise<AppCheckToken>;
3951
}
4052

53+
/**
54+
* The token returned from an `AppCheckProvider`.
55+
*/
4156
interface AppCheckToken {
57+
/**
58+
* The token string in JWT format.
59+
*/
4260
readonly token: string;
4361
/**
4462
* The local timestamp after which the token will expire.

packages/firebase/index.d.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,19 +1469,45 @@ declare namespace firebase.appCheck {
14691469
export interface AppCheck {
14701470
/**
14711471
* Activate AppCheck
1472-
* @param siteKeyOrOrovider - reCAPTCHA sitekey or custom token provider
1472+
* @param siteKeyOrProvider - reCAPTCHA sitekey or custom token provider
1473+
* @param isTokenAutoRefreshEnabled - If true, enables SDK to automatically
1474+
* refresh AppCheck token as needed. If undefined, the value will default
1475+
* to the value of `app.automaticDataCollectionEnabled`. That property
1476+
* defaults to false and can be set in the app config.
1477+
*/
1478+
activate(
1479+
siteKeyOrProvider: string | AppCheckProvider,
1480+
isTokenAutoRefreshEnabled?: boolean
1481+
): void;
1482+
1483+
/**
1484+
*
1485+
* @param isTokenAutoRefreshEnabled - If set to true, enables SDK to
1486+
* automatically refresh AppCheck token as needed. If false, disables this
1487+
* functionality. This overrides any value set during `activate()`.
14731488
*/
1474-
activate(siteKeyOrProvider: string | AppCheckProvider): void;
1489+
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
14751490
}
14761491

1492+
/**
1493+
* An AppCheck provider. This may be either the built-in reCAPTCHA provider
1494+
* or a custom provider. For more on custom providers, see
1495+
* https://firebase.google.com/docs/app-check/web-custom-provider
1496+
*/
14771497
interface AppCheckProvider {
14781498
/**
1479-
* returns an AppCheck token
1499+
* Returns an AppCheck token.
14801500
*/
14811501
getToken(): Promise<AppCheckToken>;
14821502
}
14831503

1504+
/**
1505+
* The token returned from an `AppCheckProvider`.
1506+
*/
14841507
interface AppCheckToken {
1508+
/**
1509+
* The token string in JWT format.
1510+
*/
14851511
readonly token: string;
14861512
/**
14871513
* The local timestamp after which the token will expire.

0 commit comments

Comments
 (0)