You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -298,24 +289,6 @@ This function can also provide additional context for handling missing identitie
298
289
|`true`| The identity is not available. This value indicates any of the following:<br/>- The user has opted out.<br/>- The refresh token has expired.<br/>- A first-party cookie is not available and no server-generated identity has been supplied. |
299
290
|`false`| This value indicates one of the following:<br/>- The identity is present and valid.<br/>- The identity has expired, and the token was not refreshed due to an intermittent error. The identity might be restored after a successful auto-refresh attempt. |
300
291
301
-
### isIdentityAvailable(): boolean <New3100 />
302
-
303
-
Specifies whether an identity is available. An identity can be available if there is an identity, in local storage or a cookie, that is not expired, or if there is an active request.
304
-
305
-
If false, a UID2 [POST /token/generate](../endpoints/post-token-generate.md) call is required.
306
-
307
-
```html
308
-
<script>
309
-
__uid2.isIdentityAvailable();
310
-
</script>
311
-
```
312
-
#### Return Values
313
-
314
-
| Value | Description |
315
-
| :--- | :--- |
316
-
|`true`| This value indicates one of the following:<br/>- The identity is present and valid in a first-party cookie or local storage.<br/>- The identity has expired, and the token was not refreshed due to an intermittent error. The identity might be restored after a successful auto-refresh attempt. |
317
-
|`false`| This value indicates any of the following:<br/>- The user has opted out.<br/>- The identity is present, but the refresh token has expired.<br/>- A first-party cookie is not available and no server-generated identity has been supplied. |
318
-
319
292
### disconnect(): void
320
293
321
294
Clears the UID2 identity from the [first-party cookie](#uid2-cookie-format). This closes the client's identity session and disconnects the client lifecycle.
@@ -330,10 +303,8 @@ When a user logs out of the publisher's site, make the following call:
330
303
331
304
After this function is executed, the [getAdvertisingToken()](#getadvertisingtoken-string) function returns `undefined` and the [isLoginRequired()](#isloginrequired-boolean) function returns `true`.
332
305
333
-
### abort(): void <Deprecated3100 />
306
+
### abort(): void
334
307
335
-
This function is deprecated and will be removed altogether in June of 2025. Use [disconnect()](#disconnect-void) instead as it performs the same logic as `abort()` plus a more thorough disconnection.
336
-
337
308
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
338
309
339
310
This function is intended for use in advanced scenarios where you might want to replace the existing UID2 object with a new instance. For example, a single-page application could use this to clear the current UID2 object and construct or initialize a new one after receiving a new identity from the server in the [POST /token/generate](../endpoints/post-token-generate.md) response.
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-javascript.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,14 @@ export const New = () => (
15
15
<spanclassName='pill'>NEW IN V3</span>
16
16
);
17
17
18
+
export const New3100 = () => (
19
+
<spanclassName='pill'>New in version 3.10.0</span>
20
+
);
21
+
22
+
export const Deprecated3100 = () => (
23
+
<spanclassName='pill'>Deprecated in version 3.10.0</span>
24
+
);
25
+
18
26
# SDK for JavaScript Reference Guide
19
27
20
28
Use this SDK to facilitate the process of generating or establishing client identity using UID2, retrieving advertising tokens for <Linkhref="../ref-info/glossary-uid#gl-bidstream">bidstream</Link> use, and automatically refreshing UID2 tokens.
@@ -261,8 +269,9 @@ All interactions with the SDK for JavaScript are done through the global `__uid2
@@ -424,6 +433,24 @@ Specifies whether a UID2 [POST /token/generate](../endpoints/post-token-gen
424
433
|`false`| This value indicates one of the following:<ul><li>The identity is present and valid.</li><li>The identity has expired (but the refresh token has not expired), and the token was not refreshed due to an intermittent error. The identity might be restored after a successful auto-refresh attempt.</li></ul> |
425
434
|`undefined`| The SDK initialization is not yet complete. |
426
435
436
+
### isIdentityAvailable(): boolean <New3100 />
437
+
438
+
Specifies whether an identity is available. An identity can be available if there is an identity, in local storage or a cookie, that is not expired, or if there is an active request.
439
+
440
+
If false, a UID2 [POST /token/generate](../endpoints/post-token-generate.md) call is required.
441
+
442
+
```html
443
+
<script>
444
+
__uid2.isIdentityAvailable();
445
+
</script>
446
+
```
447
+
#### Return Values
448
+
449
+
| Value | Description |
450
+
| :--- | :--- |
451
+
|`true`| This value indicates one of the following:<br/>- The identity is present and valid in a first-party cookie or local storage.<br/>- The identity has expired, and the token was not refreshed due to an intermittent error. The identity might be restored after a successful auto-refresh attempt. |
452
+
|`false`| This value indicates any of the following:<br/>- The user has opted out.<br/>- The identity is present, but the refresh token has expired.<br/>- A first-party cookie is not available and no server-generated identity has been supplied. |
453
+
427
454
### disconnect(): void
428
455
429
456
Clears the UID2 identity from the first-party cookie and local storage (see [UID2 Storage Format](#uid2-storage-format)). This closes the client's identity session and disconnects the client lifecycle.
@@ -442,7 +469,9 @@ After this function is executed, the [getAdvertisingToken()](#getadvertisingtoke
442
469
If you need to provide a `cookieDomain` or `cookiePath` for the SDK to access the correct cookie, and `init` has not been completed, the SDK cannot clear the cookie. In this case, no error is raised.
443
470
:::
444
471
445
-
### abort(): void
472
+
### abort(): void <Deprecated3100 />
473
+
474
+
This function is deprecated and will be removed altogether in June of 2025. Use [disconnect()](#disconnect-void) instead as it performs the same logic as `abort()` plus a more thorough disconnection.
446
475
447
476
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
0 commit comments