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

CEE Id System: Added functionality to request endpoint for ID - documentation #5896

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
16 changes: 10 additions & 6 deletions dev-docs/modules/userid-submodules/ceeIdSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ gulp build --modules=ceeIdSystem
| storage.expires | Optional | Int | Time when storage should expire it is recommended to use this options otherwise storage last only during session | `7` |
| storage.refreshInSeconds | Optional | Int | Time when storage value and expiration date will get refreshed in seconds | `360` |
| params | Required | Object | Container of all module params. | |
| params.tokenName | Required | String | Your custom name of token to read | `'myExampleTokenName'` |
| params.value | Optional | String | Optional param if you want to pass token value directly through setConfig | `'someTokenValue'` |
| params.publisherId | Required | String | Required param which defines your publisher ID to send in query | `'123'` |
| params.type | Required | String | Required param which defines type of encoding used on user email. Use 'email' if HEM was encoded by base64 or use 'hex' if it was encoded by hex | `'hex'` |
| params.value | Required | String | Required param where you pass HEM value | `'exampleHEMValue'` |
| params.cookieName | Optional | String | Your custom name of token to read it is only used if second way of integration is chosen. | `'myExampleCookieName'` |

## CEEID Examples

You can configure this submodule in your `userSync.userIds[]` configuration. Publishers manage ceeIds themselves can store ceeIds in local storage or 1st party cookies. You can use your custom name of token to read
You can configure this submodule in your `userSync.userIds[]` configuration. We have two implementation methods depending on the publisher's needs. The first method we suggest for publishers is to provide appropriate data that will allow you to query the endpoint to retrieve the ceeId token. To query the endpoint correctly, you will need the publisher's ID in the params.publisheId field. In addition, the HEM type, i.e. how the user's email was encoded, we consider two methods: base64 encoding and hex encoding. The value of HEM should be passed in the params.value field.

```javascript
pbjs.setConfig({
Expand All @@ -48,14 +50,16 @@ pbjs.setConfig({
refreshInSeconds: 360
},
params: {
tokenName: 'name' // Your custom name of token to read
publisherId: '123', // Publisher ID
type: 'email', // use 'email' if HEM was encoded by base64 or use 'hex' if it was encoded by hex
value: 'exampleHEMValue', // HEM value
}
}]
}
});
```

Or pass value directly thorugh params.value. Note that tokenName is not required then. This param shouldn't be set if token value will be taken by tokenName
The second way is to use a token from a cookie or local storage previously prepared by the publisher. The only thing needed in this approach is to enter the name of the cookie/local storage that the module should use in the params.cookieName field.

```javascript
pbjs.setConfig({
Expand All @@ -69,7 +73,7 @@ pbjs.setConfig({
refreshInSeconds: 360
},
params: {
value: 'tokenValue'
cookieName: 'name' // Your custom name of token to read from cookies or local storage
}
}]
}
Expand Down