forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'prebid:master' into master
- Loading branch information
Showing
62 changed files
with
1,808 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* This module adds ceeId to the User ID module | ||
* The {@link module:modules/userId} module is required | ||
* @module modules/ceeId | ||
* @requires module:modules/userId | ||
*/ | ||
|
||
import { MODULE_TYPE_UID } from '../src/activities/modules.js'; | ||
import { getStorageManager } from '../src/storageManager.js'; | ||
import { submodule } from '../src/hook.js'; | ||
import {domainOverrideToRootDomain} from '../libraries/domainOverrideToRootDomain/index.js'; | ||
|
||
/** | ||
* @typedef {import('../modules/userId/index.js').Submodule} Submodule | ||
* @typedef {import('../modules/userId/index.js').IdResponse} IdResponse | ||
*/ | ||
|
||
const MODULE_NAME = 'ceeId'; | ||
const ID_TOKEN = 'WPxid'; | ||
export const storage = getStorageManager({ moduleName: MODULE_NAME, moduleType: MODULE_TYPE_UID }); | ||
|
||
/** | ||
* Reads the ID token from local storage or cookies. | ||
* @returns {string|undefined} The ID token, or undefined if not found. | ||
*/ | ||
export const readId = () => storage.getDataFromLocalStorage(ID_TOKEN) || storage.getCookie(ID_TOKEN); | ||
|
||
/** @type {Submodule} */ | ||
export const ceeIdSubmodule = { | ||
name: MODULE_NAME, | ||
gvlid: 676, | ||
|
||
/** | ||
* decode the stored id value for passing to bid requests | ||
* @function decode | ||
* @param {string} value | ||
* @returns {(Object|undefined)} | ||
*/ | ||
decode(value) { | ||
return typeof value === 'string' ? { 'ceeId': value } : undefined; | ||
}, | ||
|
||
/** | ||
* performs action to obtain id and return a value | ||
* @function | ||
* @returns {(IdResponse|undefined)} | ||
*/ | ||
getId() { | ||
const ceeIdToken = readId(); | ||
|
||
return ceeIdToken ? { id: ceeIdToken } : undefined; | ||
}, | ||
domainOverride: domainOverrideToRootDomain(storage, MODULE_NAME), | ||
eids: { | ||
'ceeId': { | ||
source: 'ceeid.eu', | ||
atype: 1 | ||
}, | ||
}, | ||
}; | ||
|
||
submodule('userId', ceeIdSubmodule); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Overview | ||
|
||
Module Name: ceeIdSystem | ||
Module Type: UserID Module | ||
Maintainer: [email protected] | ||
|
||
# Description | ||
|
||
User identification system for WPM | ||
|
||
### Prebid Params example | ||
|
||
``` | ||
pbjs.setConfig({ | ||
userSync: { | ||
userIds: [{ | ||
name: 'ceeId', | ||
storage: { | ||
type: 'cookie', | ||
name: 'ceeIdToken', | ||
expires: 7, | ||
refreshInSeconds: 360 | ||
} | ||
}] | ||
} | ||
}); | ||
``` |
Oops, something went wrong.