diff --git a/modules/1plusXRtdProvider.js b/modules/1plusXRtdProvider.js index b57cebe2d92..cc3ca0727f1 100644 --- a/modules/1plusXRtdProvider.js +++ b/modules/1plusXRtdProvider.js @@ -1,14 +1,40 @@ -// Constants -const MODULE_NAME = '' +import { submodule } from "../src/hook" +// Constants +const REAL_TIME_MODULE = 'realTimeData' +const MODULE_NAME = '1plusX' // Functions +const getBidRequestDataAsync = async (reqBidsConfigObj, config, userConsent) => { + // Maybe treat the case where we already have the audiences & segments in local storage + // Get the required config + // Call PAPI + // -- Then : + // ---- extract relevant data + // ---- set the data to the bid + // -- Catch : print err & do nothing +} // Functions exported in submodule object -const init = () => { } -const getBidRequestData = () => { } +const init = (config, userConsent) => { + // We prolly get the config again in getBidRequestData + return true; +} + +const getBidRequestData = (reqBidsConfigObj, callback, config, userConsent) => { + getBidRequestDataAsync(reqBidsConfigObj, config, userConsent) + .then(() => callback()) + .catch((err) => { + console.error(err); + callback(); + }) +} + // The RTD submodule object to be exported export const onePlusXSubmodule = { name: MODULE_NAME, init, getBidRequestData -} \ No newline at end of file +} + +// Register the onePlusXSubmodule as submodule of realTimeData +submodule(REAL_TIME_MODULE, MODULE_NAME); \ No newline at end of file