Skip to content

Commit 6e35e53

Browse files
authored
Fix documentation (#4875)
1 parent 66deb25 commit 6e35e53

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

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

+19-1
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 true, the SDK automatically
35+
* refreshes App Check tokens as needed. This overrides any value set
36+
* during `activate()`.
37+
*/
3138
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
3239
}
3340

41+
/**
42+
* An App Check provider. This can 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

+30-3
Original file line numberDiff line numberDiff line change
@@ -1469,19 +1469,46 @@ 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 v3 site key (public key) or
1473+
* custom token provider.
1474+
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
1475+
* refreshes App Check tokens as needed. If undefined, defaults to the
1476+
* value of `app.automaticDataCollectionEnabled`, which defaults to
1477+
* false and can be set in the app config.
1478+
*/
1479+
activate(
1480+
siteKeyOrProvider: string | AppCheckProvider,
1481+
isTokenAutoRefreshEnabled?: boolean
1482+
): void;
1483+
1484+
/**
1485+
*
1486+
* @param isTokenAutoRefreshEnabled If true, the SDK automatically
1487+
* refreshes App Check tokens as needed. This overrides any value set
1488+
* during `activate()`.
14731489
*/
1474-
activate(siteKeyOrProvider: string | AppCheckProvider): void;
1490+
setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled: boolean): void;
14751491
}
14761492

1493+
/**
1494+
* An App Check provider. This can be either the built-in reCAPTCHA
1495+
* provider or a custom provider. For more on custom providers, see
1496+
* https://firebase.google.com/docs/app-check/web-custom-provider
1497+
*/
14771498
interface AppCheckProvider {
14781499
/**
1479-
* returns an AppCheck token
1500+
* Returns an AppCheck token.
14801501
*/
14811502
getToken(): Promise<AppCheckToken>;
14821503
}
14831504

1505+
/**
1506+
* The token returned from an {@link firebase.appCheck.AppCheckProvider `AppCheckProvider`}.
1507+
*/
14841508
interface AppCheckToken {
1509+
/**
1510+
* The token string in JWT format.
1511+
*/
14851512
readonly token: string;
14861513
/**
14871514
* The local timestamp after which the token will expire.

0 commit comments

Comments
 (0)