Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UID2 module: Add documentation for cstg #10629

Merged
merged 20 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
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
37 changes: 36 additions & 1 deletion modules/uid2IdSystem.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
## UID2 User ID Submodule

UID2 requires initial tokens to be generated server-side. The UID2 module handles storing, providing, and optionally refreshing them. The module can operate in one of two different modes: *Client Refresh* mode or *Server Only* mode.
The UID2 module handles storing, providing, and optionally refreshing tokens. While initial tokens traditionally required server-side generation, the introduction of the *Client-Side Token Generation (CSTG)* mode offers publishers the flexibility to generate UID2 tokens directly from the module, eliminating this need. Publishers can choose to operate the module in one of three distinct modes: *Client Refresh* mode, *Server Only* mode and *Client-Side Token Generation* mode.

*Server Only* mode was originally referred to as *legacy mode*, but it is a popular mode for new integrations where publishers prefer to handle token refresh server-side.

*Client-Side Token Generation* mode is included in UID2 module by default. However, it may not be necessary for all publishers. You can instruct the build to exclude code for this feature:

```
$ gulp build --modules=uid2IdSystem --disable UID2_CSTG
```

**Important information:** UID2 is not designed to be used where GDPR applies. The module checks the passed-in consent data and will not operate if the `gdprApplies` flag is true.

## Client-Side Token Generation (CSTG) mode

Copy link

Choose a reason for hiding this comment

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

Maybe add a note in bold:

This mode is currently in the alpha stage of development. Please consult UID2 Team first as they will provide required configuration values for you to use.

For publishers seeking a purely client-side integration without the complexities of server-side involvement, the CSTG mode is highly recommended. This mode necessitates the provision of a public key, subscription ID, and directly identifying information (DII). In the CSTG mode, the module takes on the responsibility of encrypting the DII, generating the UID2 token, and handling token refreshes when necessary.
jingyi-gao-ttd marked this conversation as resolved.
Show resolved Hide resolved

To configure the module to use this mode, you must:
1. Set `parmas.serverPublicKey` and `params.subscription`
2. Provide **ONLY ONE DII** by set `params.email`/`params.phone`/`params.emailHash`/`params.phoneHash`
jingyi-gao-ttd marked this conversation as resolved.
Show resolved Hide resolved

jingyi-gao-ttd marked this conversation as resolved.
Show resolved Hide resolved
### CSTG example

Configuration:
```
pbjs.setConfig({
userSync: {
userIds: [{
name: 'uid2',
params: {
serverPublicKey: '...server public key...',
subscriptionId: '...subcription id...',
email: '[email protected]',
//phone: '+0000000',
//emailHash: '...email hash...',
//phoneHash: '...phone hash ...'
}
}]
}
});
```

Copy link

Choose a reason for hiding this comment

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

Do we need to add the description of the new CSTG specific params in the
Parameter Descriptions for the usersync Configuration Section

at the bottom of the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've addressed the changes and added CSTG specific params to the parameter description table

Copy link

Choose a reason for hiding this comment

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

Thanks let's wait for Kimberley to come back to confirm the CSTG feature naming and then we can further modify this PR if necessary

Copy link

Choose a reason for hiding this comment

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

let's push ahead with current naming until PMs can decide on the final naming

## Client Refresh mode

This is the recommended mode for most scenarios. In this mode, the full response body from the UID2 Token Generate or Token Refresh endpoint must be provided to the module. As long as the refresh token remains valid, the module will refresh the advertising token as needed.
Expand Down