diff --git a/docs/sdks/sdk-ref-javascript-v2.md b/docs/sdks/sdk-ref-javascript-v2.md index 6debd34ec..ebf44a3c3 100644 --- a/docs/sdks/sdk-ref-javascript-v2.md +++ b/docs/sdks/sdk-ref-javascript-v2.md @@ -336,4 +336,4 @@ The following is an example of the UID2 cookie structure: :::important 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. -::: +::: \ No newline at end of file diff --git a/docs/sdks/sdk-ref-javascript.md b/docs/sdks/sdk-ref-javascript.md index 3e3426780..e74d5e09d 100644 --- a/docs/sdks/sdk-ref-javascript.md +++ b/docs/sdks/sdk-ref-javascript.md @@ -15,6 +15,14 @@ export const New = () => ( NEW IN V3 ); +export const New3100 = () => ( + New in version 3.10.0 +); + +export const Deprecated3100 = () => ( + Deprecated in version 3.10.0 +); + # SDK for JavaScript Reference Guide Use this SDK to facilitate the process of generating or establishing client identity using UID2, retrieving advertising tokens for bidstream use, and automatically refreshing UID2 tokens. @@ -261,8 +269,9 @@ All interactions with the SDK for JavaScript are done through the global `__uid2 - [getAdvertisingToken()](#getadvertisingtoken-string) - [getAdvertisingTokenAsync()](#getadvertisingtokenasync-promise) - [isLoginRequired()](#isloginrequired-boolean) +- [isIdentityAvailable()](#isidentityavailable-boolean) - [disconnect()](#disconnect-void) -- [abort()](#abort-void) +- [abort()](#abort-void) - [callbacks](#callbacks) - [setIdentity()](#setidentityidentity-identity-void) - [getIdentity()](#getidentity-identity--null) @@ -422,7 +431,26 @@ Specifies whether a UID2 [POST /token/generate](../endpoints/post-token-gen | :--- | :--- | | `true` | The identity is not available. This value indicates any of the following:
  • The user has opted out.
  • The refresh token has expired.
  • A first-party cookie is not available and no server-generated identity has been supplied.
| | `false` | This value indicates one of the following:
  • The identity is present and valid.
  • 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.
| -| `undefined` | The SDK initialization is not yet complete. | + +### isIdentityAvailable(): boolean + + + +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. + +If false, a UID2 [POST /token/generate](../endpoints/post-token-generate.md) call is required. + +```html + +``` +#### Return Values + +| Value | Description | +| :--- | :--- | +| `true` | This value indicates one of the following:
  • The identity is present and valid in a first-party cookie or local storage.
  • 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.
| +| `false` | This value indicates any of the following:
  • The user has opted out.
  • The identity is present, but the refresh token has expired.
  • The identity has expired, even if the refresh token is still valid.
  • A first-party cookie is not available and no server-generated identity has been supplied.
| ### disconnect(): void @@ -443,6 +471,10 @@ If you need to provide a `cookieDomain` or `cookiePath` for the SDK to access th ::: ### abort(): void + + + +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. Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.