You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-javascript-v2.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
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.
4
4
hide_table_of_contents: false
5
5
sidebar_position: 02
6
6
---
@@ -9,10 +9,10 @@ import Link from '@docusaurus/Link';
9
9
import ExampleUid2Cookie from '/docs/snippets/_example-uid2-cookie.mdx';
10
10
import ExampleJavaScriptV2Init from '/docs/snippets/_example-javascript-v2-init.mdx';
11
11
12
-
# SDK for JavaScript Reference Guide (2.x and earlier versions)
12
+
# SDK for JavaScript Reference Guide (v2.x and earlier)
13
13
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.
16
16
:::
17
17
18
18
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:
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-javascript.md
+23-36Lines changed: 23 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,6 @@ import Link from '@docusaurus/Link';
11
11
import ExampleUid2Cookie from '/docs/snippets/_example-uid2-cookie.mdx';
12
12
import ExampleJavaScriptInit from '/docs/snippets/_example-javascript-init.mdx';
13
13
14
-
export const New = () => (
15
-
<spanclassName='pill'>NEW IN V3</span>
16
-
);
17
-
18
-
export const New3100 = () => (
19
-
<spanclassName='pill'>New in version 3.10.0</span>
20
-
);
21
-
22
-
export const Deprecated3100 = () => (
23
-
<spanclassName='pill'>Deprecated in version 3.10.0</span>
24
-
);
25
-
26
14
# SDK for JavaScript Reference Guide
27
15
28
16
Use this SDK to facilitate the process of generating or establishing client identity using UID2, retrieving advertising tokens for <Linkhref="../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
33
21
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).
34
22
:::
35
23
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
-
38
24
For integration steps for content publishers, refer to either of the following:
39
25
-[Client-Side Integration Guide for JavaScript](../guides/integration-javascript-client-side.md)
40
26
-[Client-Server Integration Guide for JavaScript](../guides/integration-javascript-client-server.md)
41
27
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
+
42
42
## Functionality
43
43
44
44
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
@@ -333,7 +332,7 @@ The `opts` object supports the following properties.
333
332
|`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`|
334
333
|`cookiePath`| string | Optional | The path string to apply to the UID2 cookie (see [UID2 Storage Format](#uid2-storage-format)). |`/`|
335
334
|`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 |
337
336
338
337
#### Multiple Init Calls
339
338
@@ -439,8 +438,6 @@ Specifies whether a UID2 [POST /token/generate](../endpoints/post-token-gen
439
438
440
439
### isIdentityAvailable(): boolean
441
440
442
-
<New3100 />
443
-
444
441
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.
445
442
446
443
If false, a UID2 [POST /token/generate](../endpoints/post-token-generate.md) call is required.
@@ -475,16 +472,6 @@ After this function is executed, the [getAdvertisingToken()](#getadvertisingtoke
475
472
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.
476
473
:::
477
474
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
-
488
475
### callbacks
489
476
490
477
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:
542
529
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.
543
530
:::
544
531
545
-
## Migration Guide
532
+
## Migration Guide[GWH__AS03 this section needs updating]
546
533
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:
548
535
549
536
-[Benefits of Migrating](#benefits-of-migrating)
550
537
-[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
563
550
- If you rely on setting a first-party cookie to provide a new identity, you do not gain any benefit from this change.
564
551
- If you only provide the identity by passing it to `init`, the SDK no longer writes to the cookie.
565
552
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.
567
554
- The legacy callback system has been deprecated and will eventually be removed.
568
555
569
556
By updating your integration, you can take advantage of the additional features available:
@@ -9,9 +9,9 @@ import Link from '@docusaurus/Link';
9
9
import ExampleUid2Cookie from '../snippets/_example-uid2-cookie.mdx';
10
10
import ExampleJavaScriptV2Init from '../snippets/_example-javascript-v2-init.mdx';
11
11
12
-
# SDK for JavaScript Reference Guide (2.x and earlier versions)
12
+
# SDK for JavaScript Reference Guide (v2.x and earlier)
13
13
14
-
:::tip
14
+
:::important
15
15
このドキュメントは、SDK for JavaScript の旧バージョン用です。以前のバージョンを使用している場合は、アップグレードすることを勧めます。移行ガイドを含む [SDK for JavaScript Reference Guide](sdk-ref-javascript.md) を参照してください。
0 commit comments