Skip to content

Update RTD submodule documentation: reflect Proxy-based ortb2Fragments.bidder mutation pattern (10.x) #6341

@lucor

Description

@lucor

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 set trap
  • 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

No labels
No labels

Type

No type

Projects

Status

Ready for Dev

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions