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
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-javascript-v2.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -336,4 +336,4 @@ The following is an example of the UID2 cookie structure:
336
336
337
337
:::important
338
338
The contents of the `private` object are explicitly unspecified and are left for the SDK to interpret. Do not make any assumptions about the structure, semantics, or compatibility of this object. Any updates to the cookie must retain its structure.
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-javascript.md
+34-2Lines changed: 34 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
@@ -422,7 +431,26 @@ Specifies whether a UID2 [POST /token/generate](../endpoints/post-token-gen
422
431
| :--- | :--- |
423
432
|`true`| The identity is not available. This value indicates any of the following:<ul><li>The user has opted out.</li><li>The refresh token has expired.</li><li>A first-party cookie is not available and no server-generated identity has been supplied.</li></ul> |
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
-
|`undefined`| The SDK initialization is not yet complete. |
434
+
435
+
### isIdentityAvailable(): boolean
436
+
437
+
<New3100 />
438
+
439
+
Determines whether an identity is available: for example, if there is an unexpired identity in local storage or in a cookie, or if an identity has already been requested.
440
+
441
+
If false, a UID2 [POST /token/generate](../endpoints/post-token-generate.md) call is required.
442
+
443
+
```html
444
+
<script>
445
+
__uid2.isIdentityAvailable();
446
+
</script>
447
+
```
448
+
#### Return Values
449
+
450
+
| Value | Description |
451
+
| :--- | :--- |
452
+
|`true`| This value indicates one of the following:<ul><li> The identity is present and valid in a first-party cookie or local storage.</li><li> 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.</li></ul> |
453
+
|`false`| This value indicates any of the following:<ul><li> The user has opted out.</li><li> The identity is present, but the refresh token has expired.</li><li> The identity has expired, even if the refresh token is still valid.</li><li> A first-party cookie is not available and no server-generated identity has been supplied. </li></ul> |
426
454
427
455
### disconnect(): void
428
456
@@ -443,6 +471,10 @@ If you need to provide a `cookieDomain` or `cookiePath` for the SDK to access th
443
471
:::
444
472
445
473
### abort(): void
474
+
475
+
<Deprecated3100 />
476
+
477
+
This function is deprecated and support will be removed completely in June of 2025. Instead, use [disconnect()](#disconnect-void) which has the same functionality as `abort()`, but also includes more thorough disconnection logic.
446
478
447
479
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
0 commit comments