Skip to content

Expose completion state, raw data and page-supplied evidence on the fod object - #15

Open
YaroslavVlasenko wants to merge 3 commits into
mainfrom
feature/fod-page-contract
Open

Expose completion state, raw data and page-supplied evidence on the fod object#15
YaroslavVlasenko wants to merge 3 commits into
mainfrom
feature/fod-page-contract

Conversation

@YaroslavVlasenko

Copy link
Copy Markdown

What

Two additions to the JavaScript template:

  1. The generated object (default name fod) now exposes two public properties alongside the existing complete() / onChange() API:
  • isComplete: false while evidence collection is in flight, true once processing has finished (successfully or not; see data.errors).
  • data: the latest raw JSON payload. Unlike the property getters it keeps missing values as null instead of the null-reason text.
  1. A page can supply extra evidence for the JSON refresh request by defining a plain string-to-string object named <ObjectName>Evidence (default fodEvidence) before the script executes. Each entry is url-encoded and appended to the form-data body of the existing POST request. The values are never written to the URL, cookies or web storage, so this is the supported way to pass sensitive evidence.

Both are documented in the README.

Why

This lets an on-page 51Degrees integration share its result with other consumers. The first consumer is the Prebid.js 51Degrees RTD module: it detects fod on the page automatically and enriches the bid request from it instead of loading a second copy of the script.
The evidence object gives pages a way to pass evidence that must not appear in a URL or persist in the browser.
Without <ObjectName>Evidence on the page the generated script behaves exactly as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant