Skip to content

Commit d625fce

Browse files
moved docs over
1 parent 3568dd0 commit d625fce

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

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

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ import Link from '@docusaurus/Link';
99
import ExampleUid2Cookie from '/docs/snippets/_example-uid2-cookie.mdx';
1010
import ExampleJavaScriptV2Init from '/docs/snippets/_example-javascript-v2-init.mdx';
1111

12-
export const New3100 = () => (
13-
<span className='pill'>New in version 3.10.0</span>
14-
);
15-
16-
export const Deprecated3100 = () => (
17-
<span className='pill'>Deprecated in version 3.10.0</span>
18-
);
19-
2012
# SDK for JavaScript Reference Guide (2.x and earlier versions)
2113

2214
:::tip
@@ -128,7 +120,6 @@ All interactions with the Client-Side JavaScript SDK are done through the global
128120
- [getAdvertisingToken()](#getadvertisingtoken-string)
129121
- [getAdvertisingTokenAsync()](#getadvertisingtokenasync-promise)
130122
- [isLoginRequired()](#isloginrequired-boolean)
131-
- [isIdentityAvailable()](#isidentityavailable-boolean)
132123
- [disconnect()](#disconnect-void)
133124
- [abort()](#abort-void)
134125

@@ -298,24 +289,6 @@ This function can also provide additional context for handling missing identitie
298289
| `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. |
299290
| `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. |
300291

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&nbsp;/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-
319292
### disconnect(): void
320293

321294
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:
330303

331304
After this function is executed, the [getAdvertisingToken()](#getadvertisingtoken-string) function returns `undefined` and the [isLoginRequired()](#isloginrequired-boolean) function returns `true`.
332305

333-
### abort(): void <Deprecated3100 />
306+
### abort(): void
334307

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-
337308
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
338309

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

docs/sdks/sdk-ref-javascript.md

Lines changed: 31 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 />
@@ -424,6 +433,24 @@ Specifies whether a UID2 [POST&nbsp;/token/generate](../endpoints/post-token-gen
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> |
425434
| `undefined` | The SDK initialization is not yet complete. |
426435

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&nbsp;/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+
427454
### disconnect(): void
428455

429456
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
442469
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.
443470
:::
444471

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.
446475

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

0 commit comments

Comments
 (0)