Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/sdks/sdk-ref-javascript-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
:::
36 changes: 34 additions & 2 deletions docs/sdks/sdk-ref-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const New = () => (
<span className='pill'>NEW IN V3</span>
);

export const New3100 = () => (
<span className='pill'>New in version 3.10.0</span>
);

export const Deprecated3100 = () => (
<span className='pill'>Deprecated in version 3.10.0</span>
);

# SDK for JavaScript Reference Guide

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.
Expand Down Expand Up @@ -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) <New />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a broken link. Also the other update.
I suggest that you don't mess with the headings but instead maybe, for those two functions, put the "new in" or "deprecated" on the next line, after the heading. For the other functions that have tags, they've been omitted in the body copy. I think it's good info to have with the content, but if you put it in the heading, because it's Markdown, you'd have to update the link.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with the latest update... all good, thx.

- [disconnect()](#disconnect-void)
- [abort()](#abort-void)
- [abort()](#abort-void) <Deprecated3100 />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Link is broken.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now. Thx.

- [callbacks](#callbacks) <New />
- [setIdentity()](#setidentityidentity-identity-void) <New />
- [getIdentity()](#getidentity-identity--null) <New />
Expand Down Expand Up @@ -422,7 +431,26 @@ Specifies whether a UID2 [POST&nbsp;/token/generate](../endpoints/post-token-gen
| :--- | :--- |
| `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> |
| `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> |
| `undefined` | The SDK initialization is not yet complete. |

### isIdentityAvailable(): boolean

<New3100 />

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&nbsp;/token/generate](../endpoints/post-token-generate.md) call is required.

```html
<script>
__uid2.isIdentityAvailable();
</script>
```
#### Return Values

| Value | Description |
| :--- | :--- |
| `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> |
| `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> |

### disconnect(): void

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

### abort(): void

<Deprecated3100 />

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.

Expand Down
Loading