schain 1.1

Open
#16,241 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@mkomorski is already working on this.

Since Nov 19, 2026.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active

Research direction

Start with the listed src/types/ortb definitions, libraries/schainSerializer, libraries/fpdUtils/validateFpd.ts, and src/fpd/merge.ts; then trace the named adapters and their tests. The issue proposes a shared 1.1 fixture covering complete: 2 and hp: 0, plus an opt-in downgrade path and documentation updates. Done means those areas handle the cases described, with adapter and utility tests confirming the expected chains.

Written by the indexing model from the issue text.

Description

🤖 This description was rewritten by an AI agent (Claude Code) on behalf of @patmmccann.

SupplyChain 1.1 is about to land in OpenRTB 2.6, on the develop branch of openrtb2.x, with implementation guidance in IAB's Supply-Chain-Validation repo. Prebid.js should handle 1.1 chains correctly, and be able to send 1.0 to recipients that can't take 1.1.

What changes in 1.1

  • What the chain means: it changes from "all entities involved in the direct flow of payment" to "all entities who take custody of a given bid request". Every entity that can initiate or route the request (wrappers, server-side header bidding, mediation, SSAI) is listed, client-side or server-side. Everything that was in 1.0 stays.
  • ver: "1.1".
  • complete: 0 = not complete, 1 = payment complete, 2 = payment and tech complete.
  • hp: 0 nodes become normal. The 1.0 sentence "this property should always be 1" is removed. hp: 0 nodes can come before the first hp: 1 node and after it, follow the order of the request rather than of payment, and need no ads.txt entry (sellers.json is strongly recommended). Payment linkage runs between hp: 1 nodes: openrtb2.x#177.
  • Preservation: a party that copies a chain must keep every received node, hp: 0 included, when it appends its own. This is proposed in Supply-Chain-Validation#8, which also asks buyers not to penalize ver: "1.1" chains under 1.0 rules.
  • Prebid.js on the publisher's own page (example WEB-4): no hp: 0 node is needed, since the publisher controls the wrapper. A server-side wrapper (WEB-1, i.e. a Prebid Server host) or a third-party client-side wrapper (WEB-3) appears as an hp: 0 node.

Open question upstream: the spec defines complete: 2 for chains that include tech (hp: 0) nodes, but the guidance's 1.1 examples still use complete: 1 on chains with hp: 0 nodes. Prebid.js should accept both.

What that means for Prebid.js

Core passes it through today. The schain module no longer validates, and normalizeFPD keeps the chain at ortb2.source.ext.schain, so ver: "1.1", complete: 2 and hp: 0 nodes reach adapters and Prebid Server unchanged. The problems are in types, shared utilities and adapters.

  1. Types: iab-openrtb's SupplyChain declares complete: 0 | 1, so TypeScript publishers can't set 2. Widen it (an override in src/types/ortb, or an upstream bump).

  2. hp: 0 is read as missing. Serializers that write node.hp || '' or node[prop] ? … : '' send an empty hp instead of 0, so a tech node looks malformed:

    • libraries/schainSerializer, used by eplanning, fwssp, smartadserver and smilewanted;
    • rubicon, gumgum, adstir, cpmstar, vidoomy and aja;
    • ucfunnel, via a ternary.

    Validators that check hp by truthiness reject the whole chain: admatic's validateSchain. The debugging module's FPD validation (libraries/fpdUtils/validateFpd.ts) also logs a spurious "missing required property hp".

    Already correct: dspx (??), riseUtils (!== undefined), stv, and the hasOwnProperty checks in rubicon, onetag and allegro.

  3. complete read by truthiness: dspx sends the chain only if complete is truthy, so it drops complete: 0 chains today.

  4. Preservation in core: by default, a bidder-specific schain's nodes are appended to the global chain's nodes (src/fpd/merge.ts; replaceGlobalSchain opts out). Check this still produces a valid 1.1 chain: it shouldn't reorder or duplicate nodes, and the global and bidder ver and complete should be reconciled.

  5. A 1.1 → 1.0 downgrade utility for recipients that can't take 1.1, with adapters or bidder config opting in (e.g. a per-bidder setting, or a field in the bid adapter spec). It would:

    • drop hp: 0 nodes;
    • set ver: "1.0";
    • map complete: 2 to 1;
    • leave a 1.0 chain unchanged.

    The default stays 1.1 pass-through, per the preservation rule.

  6. Duplicate chains: some adapters copy source.ext.schain into source.schain and leave the ext copy, so they send two chains (adferry, publinkio, yieldlab, adtrgtme, michao). defineMedia looks for a bidderRequest.source.schain that never exists, so it always adds an invented one-node complete: 1 chain alongside the publisher's real one. With 1.1 and the downgrade, those copies can disagree.

  7. Tests: a shared fixture with a 1.1 chain (ver: "1.1", complete: 2, hp: 0 nodes before and after the first hp: 1 node), run through the shared serializer, the downgrade utility, and the adapters above.

  8. Docs: the schain pages on docs.prebid.org (1.1 fields, hp: 0, the downgrade option).

Prebid Server (to file there)

  • Upgrade and downgrade: PBS converts between OpenRTB 2.5 and 2.6 locations (Go openrtb_ext/convert_up.go/convert_down.go, Java BidRequestOrtb25To26Converter/BidRequestOrtb26To25Converter), but never between schain versions. It will need the same opt-in 1.1 → 1.0 downgrade per bidder.
  • Its own node: a PBS host is the server-side wrapper in WEB-1, so it may need to append its own hp: 0 node.
  • Adapters: PBS adapters need the same hp: 0 audit.

Proposed order

  1. Types and the hp: 0 fixes (2 and 3), with the shared fixture (7).
  2. The downgrade utility and the opt-in mechanism (5).
  3. The merge behaviour (4) and the duplicate-chain adapters (6).
  4. Docs.
  5. Cross-file Prebid Server.
Dominant language
JavaScript
Stars
1.6k
Forks
2.4k
Avg merge
1d 20h
Merged PRs (30d)
291

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prebid/Prebid.js

All issues in prebid/Prebid.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.