Skip to content

Commit 27fed9b

Browse files
Merge pull request #781 from IABTechLab/ans-UID2-deprecation-docs-abort-and-isIdentityAvailable
Deprecation docs/new functions for abort and isIdentityAvailable
2 parents 301b544 + b179d4d commit 27fed9b

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

docs/sdks/sdk-ref-javascript-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,4 @@ The following is an example of the UID2 cookie structure:
336336

337337
:::important
338338
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.
339-
:::
339+
:::

docs/sdks/sdk-ref-javascript.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export const New = () => (
1515
<span className='pill'>NEW IN V3</span>
1616
);
1717

18+
export const New3100 = () => (
19+
<span className='pill'>New in version 3.10.0</span>
20+
);
21+
22+
export const Deprecated3100 = () => (
23+
<span className='pill'>Deprecated in version 3.10.0</span>
24+
);
25+
1826
# SDK for JavaScript Reference Guide
1927

2028
Use this SDK to facilitate the process of generating or establishing client identity using UID2, retrieving advertising tokens for <Link href="../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
261269
- [getAdvertisingToken()](#getadvertisingtoken-string)
262270
- [getAdvertisingTokenAsync()](#getadvertisingtokenasync-promise)
263271
- [isLoginRequired()](#isloginrequired-boolean)
272+
- [isIdentityAvailable()](#isidentityavailable-boolean) <New />
264273
- [disconnect()](#disconnect-void)
265-
- [abort()](#abort-void)
274+
- [abort()](#abort-void) <Deprecated3100 />
266275
- [callbacks](#callbacks) <New />
267276
- [setIdentity()](#setidentityidentity-identity-void) <New />
268277
- [getIdentity()](#getidentity-identity--null) <New />
@@ -422,7 +431,26 @@ Specifies whether a UID2 [POST&nbsp;/token/generate](../endpoints/post-token-gen
422431
| :--- | :--- |
423432
| `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> |
424433
| `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&nbsp;/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> |
426454

427455
### disconnect(): void
428456

@@ -443,6 +471,10 @@ If you need to provide a `cookieDomain` or `cookiePath` for the SDK to access th
443471
:::
444472

445473
### 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.
446478

447479
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
448480

0 commit comments

Comments
 (0)