@@ -1469,19 +1469,45 @@ declare namespace firebase.appCheck {
1469
1469
export interface AppCheck {
1470
1470
/**
1471
1471
* 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()`.
1473
1488
*/
1474
- activate ( siteKeyOrProvider : string | AppCheckProvider ) : void ;
1489
+ setTokenAutoRefreshEnabled ( isTokenAutoRefreshEnabled : boolean ) : void ;
1475
1490
}
1476
1491
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
+ */
1477
1497
interface AppCheckProvider {
1478
1498
/**
1479
- * returns an AppCheck token
1499
+ * Returns an AppCheck token.
1480
1500
*/
1481
1501
getToken ( ) : Promise < AppCheckToken > ;
1482
1502
}
1483
1503
1504
+ /**
1505
+ * The token returned from an `AppCheckProvider`.
1506
+ */
1484
1507
interface AppCheckToken {
1508
+ /**
1509
+ * The token string in JWT format.
1510
+ */
1485
1511
readonly token : string ;
1486
1512
/**
1487
1513
* The local timestamp after which the token will expire.
0 commit comments