Skip to content

Commit 4ff9474

Browse files
authored
Fix AppCheck getToken docs text (#8454)
1 parent 5594ebc commit 4ff9474

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs-devsite/app-check.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Firebase App Check does not work in a Node.js environment using `ReCaptchaV3Prov
2222
| [initializeAppCheck(app, options)](./app-check.md#initializeappcheck_5548dfc) | Activate App Check for the given app. Can be called only once per app. |
2323
| <b>function(appCheckInstance, ...)</b> |
2424
| [getLimitedUseToken(appCheckInstance)](./app-check.md#getlimitedusetoken_53ef5e3) | Requests a Firebase App Check token. This method should be used only if you need to authorize requests to a non-Firebase backend.<!-- -->Returns limited-use tokens that are intended for use with your non-Firebase backend endpoints that are protected with <a href="https://firebase.google.com/docs/app-check/custom-resource-backend#replay-protection"> Replay Protection</a>. This method does not affect the token generation behavior of the \#getAppCheckToken() method. |
25-
| [getToken(appCheckInstance, forceRefresh)](./app-check.md#gettoken_39fc1b3) | Get the current App Check token. Attaches to the most recent in-flight request if one is present. Returns null if no token is present and no token requests are in-flight. |
25+
| [getToken(appCheckInstance, forceRefresh)](./app-check.md#gettoken_39fc1b3) | Get the current App Check token. If <code>forceRefresh</code> is false, this function first checks for a valid token in memory, then local persistence (IndexedDB). If not found, or if <code>forceRefresh</code> is true, it makes a request to the App Check endpoint for a fresh token. That request attaches to the most recent in-flight request if one is present. |
2626
| [onTokenChanged(appCheckInstance, observer)](./app-check.md#ontokenchanged_9761e16) | Registers a listener to changes in the token state. There can be more than one listener registered at the same time for one or more App Check instances. The listeners call back on the UI thread whenever the current token associated with this App Check instance changes. |
2727
| [onTokenChanged(appCheckInstance, onNext, onError, onCompletion)](./app-check.md#ontokenchanged_8ef80a7) | Registers a listener to changes in the token state. There can be more than one listener registered at the same time for one or more App Check instances. The listeners call back on the UI thread whenever the current token associated with this App Check instance changes. |
2828
| [setTokenAutoRefreshEnabled(appCheckInstance, isTokenAutoRefreshEnabled)](./app-check.md#settokenautorefreshenabled_057a76c) | Set whether App Check will automatically refresh tokens as needed. |
@@ -102,7 +102,7 @@ The limited use token.
102102

103103
### getToken(appCheckInstance, forceRefresh) {:#gettoken_39fc1b3}
104104

105-
Get the current App Check token. Attaches to the most recent in-flight request if one is present. Returns null if no token is present and no token requests are in-flight.
105+
Get the current App Check token. If `forceRefresh` is false, this function first checks for a valid token in memory, then local persistence (IndexedDB). If not found, or if `forceRefresh` is true, it makes a request to the App Check endpoint for a fresh token. That request attaches to the most recent in-flight request if one is present.
106106

107107
<b>Signature:</b>
108108

packages/app-check/src/api.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ export function setTokenAutoRefreshEnabled(
187187
state.isTokenAutoRefreshEnabled = isTokenAutoRefreshEnabled;
188188
}
189189
/**
190-
* Get the current App Check token. Attaches to the most recent
191-
* in-flight request if one is present. Returns null if no token
192-
* is present and no token requests are in-flight.
190+
* Get the current App Check token. If `forceRefresh` is false, this function first
191+
* checks for a valid token in memory, then local persistence (IndexedDB).
192+
* If not found, or if `forceRefresh` is true, it makes a request to the
193+
* App Check endpoint for a fresh token. That request attaches
194+
* to the most recent in-flight request if one is present.
193195
*
194196
* @param appCheckInstance - The App Check service instance.
195197
* @param forceRefresh - If true, will always try to fetch a fresh token.

0 commit comments

Comments
 (0)