Skip to content

Commit 94a87ae

Browse files
committed
Adds and updatesfor JS SDK v4
1 parent 904810a commit 94a87ae

File tree

8 files changed

+1329
-86
lines changed

8 files changed

+1329
-86
lines changed

docs/guides/integration-javascript-client-side.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ To implement, you'll need to complete the following steps:
4646

4747
Support for client-side token generation is available in version 3.4.5 and above of the SDK.
4848

49-
The URL for the SDK is:
49+
The URL for the SDK is: (**GWH__AS05 updated URL?**)
5050

5151
- [https://cdn.prod.uidapi.com/uid2-sdk-3.4.5.js](https://cdn.prod.uidapi.com/uid2-sdk-3.4.5.js)
5252

5353
In the following code examples, the placeholder `{{ UID2_JS_SDK_URL }}` refers to this URL.
5454

55-
If you want to use a debug build of the SDK, use the following URL instead:
55+
If you want to use a debug build of the SDK, use the following URL instead: (**GWH__AS04 updated URL?**)
5656

5757
- [https://cdn.integ.uidapi.com/uid2-sdk-3.4.5.js](https://cdn.integ.uidapi.com/uid2-sdk-3.4.5.js)
5858

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: SDK for JavaScript (2.x and earlier versions)
3-
description: Reference information about earlier versions of the JavaScript client-side SDK.
2+
title: SDK for JavaScript (2.x and earlier)
3+
description: Reference information about 2.x and earlier versions of the JavaScript client-side SDK.
44
hide_table_of_contents: false
55
sidebar_position: 02
66
---
@@ -9,10 +9,10 @@ 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-
# SDK for JavaScript Reference Guide (2.x and earlier versions)
12+
# SDK for JavaScript Reference Guide (v2.x and earlier)
1313

14-
:::tip
15-
This documentation is for earlier versions of the SDK for JavaScript. If you're using an earlier version, we recommend upgrading. See [SDK for JavaScript Reference Guide](sdk-ref-javascript.md), which includes a migration guide.
14+
:::important
15+
This documentation is for earlier versions of the SDK for JavaScript. If you're using an earlier version, we recommend upgrading. See [SDK for JavaScript Reference Guide](sdk-ref-javascript.md), which includes a migration guide to upgrade to the current version, v4.
1616
:::
1717

1818
Use this SDK to facilitate the process of establishing client identity using UID2 and retrieving advertising tokens. The following sections describe the high-level [workflow](#workflow-overview) for establishing UID2 identity, provide the SDK [API reference](#api-reference), and explain the [UID2 cookie format](#uid2-cookie-format).
@@ -47,11 +47,6 @@ This SDK is in the following open-source GitHub repository:
4747

4848
- [https://github.com/iabtechlab/uid2-web-integrations](https://github.com/iabtechlab/uid2-web-integrations)
4949

50-
<!-- The binary is published in these locations:
51-
52-
- NPM: [https://www.npmjs.com/package/@uid2/uid2-sdk](https://www.npmjs.com/package/@uid2/uid2-sdk)
53-
- CDN: [https://cdn.prod.uidapi.com/uid2-sdk-${VERSION_ID}.js](https://cdn.prod.uidapi.com/uid2-sdk-${VERSION_ID}.js) (** v3 JS SDK: stash per SW 8/15/23**) -->
54-
5550
## Terminology
5651

5752
In this document, the following terms apply:

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

Lines changed: 643 additions & 0 deletions
Large diffs are not rendered by default.

docs/sdks/sdk-ref-javascript.md

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ import Link from '@docusaurus/Link';
1111
import ExampleUid2Cookie from '/docs/snippets/_example-uid2-cookie.mdx';
1212
import ExampleJavaScriptInit from '/docs/snippets/_example-javascript-init.mdx';
1313

14-
export const New = () => (
15-
<span className='pill'>NEW IN V3</span>
16-
);
17-
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-
2614
# SDK for JavaScript Reference Guide
2715

2816
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.
@@ -33,12 +21,24 @@ The following sections describe the high-level [workflow](#workflow-overview) fo
3321
If you're using Prebid.js with the UID2 Identity Module, or with another product that has UID2 support, you probably don't need to use the SDK at all. The Prebid.js module manages everything. For details, see [UID2 Client-Side Integration Guide for Prebid.js](../guides/integration-prebid-client-side.md).
3422
:::
3523

36-
This page describes version 3 of the SDK. If you are using an earlier version, we recommend that you upgrade your integration, using the [migration guide](#migration-guide). If needed, documentation for [earlier versions of the SDK](./sdk-ref-javascript-v2.md) is also available.
37-
3824
For integration steps for content publishers, refer to either of the following:
3925
- [Client-Side Integration Guide for JavaScript](../guides/integration-javascript-client-side.md)
4026
- [Client-Server Integration Guide for JavaScript](../guides/integration-javascript-client-server.md)
4127

28+
## SDK Version
29+
30+
This page describes version 4 of the UID2 SDK for JavaScript, which is the latest version. If you're using an earlier version, we recommend that you upgrade your integration, using the [migration guide](#migration-guide). If needed, documentation is also available for the following earlier versions:
31+
32+
- [Version 3](./sdk-ref-javascript-v3.md)
33+
- [Version 2.x and earlier](./sdk-ref-javascript-v2.md)
34+
35+
## Changes From Previous Version
36+
37+
Version 4 includes the following key changes from version 3:
38+
39+
- **New**: [**GWH__AS01 include any info here re changes, updates, new stuff.**]
40+
- **Deprecated elements**: the `abort()` function was deprecated in v3 and is not part of v4. Instead, use [disconnect()](#disconnect-void) which has the same functionality as `abort()`, but also includes more thorough disconnection logic.
41+
4242
## Functionality
4343

4444
This SDK simplifies development for publishers who want to build their own customized UID2 integration. The following table shows the functions it supports.
@@ -274,13 +274,12 @@ All interactions with the SDK for JavaScript are done through the global `__uid2
274274
- [getAdvertisingToken()](#getadvertisingtoken-string)
275275
- [getAdvertisingTokenAsync()](#getadvertisingtokenasync-promise)
276276
- [isLoginRequired()](#isloginrequired-boolean)
277-
- [isIdentityAvailable()](#isidentityavailable-boolean) <New3100 />
277+
- [isIdentityAvailable()](#isidentityavailable-boolean)
278278
- [disconnect()](#disconnect-void)
279-
- [abort()](#abort-void) <Deprecated3100 />
280-
- [callbacks](#callbacks) <New />
281-
- [setIdentity()](#setidentityidentity-identity-void) <New />
282-
- [getIdentity()](#getidentity-identity--null) <New />
283-
- [isInitComplete()](#isinitcomplete-boolean) <New />
279+
- [callbacks](#callbacks)
280+
- [setIdentity()](#setidentityidentity-identity-void)
281+
- [getIdentity()](#getidentity-identity--null)
282+
- [isInitComplete()](#isinitcomplete-boolean)
284283

285284
### constructor()
286285

@@ -333,7 +332,7 @@ The `opts` object supports the following properties.
333332
| `cookieDomain` | string | Optional | The domain name string to apply to the UID2 cookie (see [UID2 Storage Format](#uid2-storage-format)).<br/>For example, if the `baseUrl` is `https://my.operator.com`, the `cookieDomain` value might be `operator.com`. | `undefined` |
334333
| `cookiePath` | string | Optional | The path string to apply to the UID2 cookie (see [UID2 Storage Format](#uid2-storage-format)). | `/` |
335334
| `useCookie` | `boolean` | Optional | Set this to `true` to tell the SDK to store the identity in cookie storage instead of local storage. You can still provide an identity using a first-party cookie if this value is false or not provided. |
336-
| `callback` | `function(object): void` | Deprecated | The function that the SDK should invoke after validating the passed identity. Do not use this for new integrations. | N/A |
335+
| `callback` | `function(object): void` | Deprecated | The function that the SDK should invoke after validating the passed identity. Do not use this for new integrations. [**GWH__AS02 do we need to remove this line?**] | N/A |
337336

338337
#### Multiple Init Calls
339338

@@ -439,8 +438,6 @@ Specifies whether a UID2 [POST&nbsp;/token/generate](../endpoints/post-token-gen
439438

440439
### isIdentityAvailable(): boolean
441440

442-
<New3100 />
443-
444441
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.
445442

446443
If false, a UID2 [POST&nbsp;/token/generate](../endpoints/post-token-generate.md) call is required.
@@ -475,16 +472,6 @@ After this function is executed, the [getAdvertisingToken()](#getadvertisingtoke
475472
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.
476473
:::
477474

478-
### abort(): void
479-
480-
<Deprecated3100 />
481-
482-
This function is deprecated and support will be removed soon. Instead, use [disconnect()](#disconnect-void) which has the same functionality as `abort()`, but also includes more thorough disconnection logic.
483-
484-
Terminates any background timers or requests. The UID2 object remains in an unspecified state and cannot be used anymore.
485-
486-
This function is intended for use in advanced scenarios where you might want to replace the existing UID2 object with a new instance.
487-
488475
### callbacks
489476

490477
This is an array that stores all of the registered callbacks. You should only interact with it using the [Array Push Pattern](#array-push-pattern).
@@ -542,9 +529,9 @@ The following is an example of the UID2 cookie structure:
542529
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.
543530
:::
544531

545-
## Migration Guide
532+
## Migration Guide [GWH__AS03 this section needs updating]
546533

547-
This section includes all the information you need to upgrade from an earlier version of the SDK for JavaScript to the current version, v3. It includes:
534+
This section includes all the information you need to upgrade from an earlier version of the SDK for JavaScript to the current version, v4. It includes:
548535

549536
- [Benefits of Migrating](#benefits-of-migrating)
550537
- [Required Changes](#required-changes)
@@ -563,7 +550,7 @@ If your existing integration uses version 1.x or 2.x of the SDK, version 3 is fu
563550
- If you rely on setting a first-party cookie to provide a new identity, you do not gain any benefit from this change.
564551
- If you only provide the identity by passing it to `init`, the SDK no longer writes to the cookie.
565552

566-
Some of the functionality from versions 1.x and 2.x has been deprecated, and you should make changes to future-proof your integration.
553+
Some of the functionality from earlier versions has been deprecated, and you should make changes to future-proof your integration.
567554
- The legacy callback system has been deprecated and will eventually be removed.
568555

569556
By updating your integration, you can take advantage of the additional features available:

i18n/ja/docusaurus-plugin-content-docs/current/sdks/sdk-ref-javascript-v2.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: SDK for JavaScript (2.x and earlier versions)
2+
title: SDK for JavaScript (2.x and earlier)
33
description: JavaScript Client-Side SDK の旧バージョンに関するリファレンス情報。
44
hide_table_of_contents: false
55
sidebar_position: 02
@@ -9,9 +9,9 @@ import Link from '@docusaurus/Link';
99
import ExampleUid2Cookie from '../snippets/_example-uid2-cookie.mdx';
1010
import ExampleJavaScriptV2Init from '../snippets/_example-javascript-v2-init.mdx';
1111

12-
# SDK for JavaScript Reference Guide (2.x and earlier versions)
12+
# SDK for JavaScript Reference Guide (v2.x and earlier)
1313

14-
:::tip
14+
:::important
1515
このドキュメントは、SDK for JavaScript の旧バージョン用です。以前のバージョンを使用している場合は、アップグレードすることを勧めます。移行ガイドを含む [SDK for JavaScript Reference Guide](sdk-ref-javascript.md) を参照してください。
1616
:::
1717

@@ -46,10 +46,6 @@ SDK が提供する特定の機能の使用許可が与えられ、そのアク
4646

4747
- [https://github.com/iabtechlab/uid2-web-integrations](https://github.com/iabtechlab/uid2-web-integrations)
4848

49-
<!-- The binary is published in these locations:
50-
51-
- NPM: [https://www.npmjs.com/package/@uid2/uid2-sdk](https://www.npmjs.com/package/@uid2/uid2-sdk)
52-
- CDN: [https://cdn.prod.uidapi.com/uid2-sdk-${VERSION_ID}.js](https://cdn.prod.uidapi.com/uid2-sdk-${VERSION_ID}.js) (** v3 JS SDK: stash per SW 8/15/23**) -->
5349

5450
## Terminology
5551

0 commit comments

Comments
 (0)