-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Problem
The official RTD submodule documentation at https://docs.prebid.org/dev-docs/add-rtd-submodule.html#getbidrequestdata contains an outdated code example that no longer aligns with the Prebid.js 10.x core RTD module behavior.
Current documented pattern:
// or in bidder-specific first party data:
config.bidders.forEach((bidderCode) =>
mergeDeep(reqBidsConfigObj.ortb2Fragments.bidder, {[bidderCode]: myCustomData})
);Root Cause
Changes introduced in Prebid.js 10.x to the core RTD module added Proxy-based validation and controlled mutation for ortb2Fragments.bidder. The documented pattern bypasses these guard mechanisms because it modifies the bidder object directly without triggering the Proxy set trap.
Possible Solution
A possible approach to update the documentation example would be using reassignment for bidder-specific FPD updates:
config.bidders.forEach((bidderCode) => {
const bd = reqBidsConfigObj.ortb2Fragments.bidder[bidderCode] || {};
mergeDeep(bd, myCustomData);
reqBidsConfigObj.ortb2Fragments.bidder[bidderCode] = bd;
});This approach might:
- Trigger the Proxy
settrap - Enable data validation via
guardOrtb2 - Maintain bidder-specific data integrity
We'd appreciate feedback on whether this is the right direction or if there are alternative patterns the Prebid.js team recommends.
Impact
RTD submodule implementers following the current documentation for 10.x may have their data bypass validation, potentially causing issues or unexpected behavior in production.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status