Skip to content

Add identity-only mode to the Prebid integration - #1620

Open
prk-Jr wants to merge 5 commits into
feat/s2s-eid-collection-providersfrom
feat/1594-identity-only-tsjs
Open

prk-Jr wants to merge 5 commits into
feat/s2s-eid-collection-providersfrom
feat/1594-identity-only-tsjs

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add opt-in integrations.prebid.mode = "identity" so publishers can use managed Prebid identity without installing Trusted Server's browser auction integration. Existing configurations default to "auction".
  • Deliver the current server mirror to publisher auctions as request-local first-party data while capturing only native User ID module EIDs into ts-eids, including pages that never run an auction.
  • Preserve publisher bidders, ad units, GPT behavior and consent activity controls. Consent-triggered EC fetching remains in Injected script calls the EC route on consent and merges the IDs into Prebid #1599.

Stacked on #1489, targeting feat/s2s-eid-collection-providers; the mirror writer must land first.

Enable identity-only mode

Update the existing table in your application configuration and publish the updated config:

[integrations.prebid]
enabled = true
mode = "identity"

Keep the existing external bundle, module selection and managed User ID settings. Add or update mode in the existing table; do not create a duplicate TOML table. Deploying the code alone does not enable this mode. Omitted mode defaults to "auction".

See the identity-only setup guide.

Changes

File Change
crates/trusted-server-core/src/integrations/prebid.rs Add typed auction/identity configuration, default and injected browser mode, with parsing and injection tests.
crates/trusted-server-js/lib/src/integrations/prebid/index.ts Retain shared managed identity setup; select identity wrapping before auction hooks, skip GPT refresh, deduplicate capture and contain blocked-cookie failures.
crates/trusted-server-js/lib/src/integrations/prebid/native_capture.ts Sample fresh native IDs without an auction; handle visibility, navigation and BFCache with one timer.
crates/trusted-server-js/lib/src/integrations/prebid/identity.ts Validate and reread the mirror per auction; merge live EIDs without mutating publisher data or persisting mirror values globally.
crates/trusted-server-js/lib/test/integrations/prebid/identity.test.ts Cover mode isolation, native capture without mirror echo, merge validation/metadata/deduplication, cookie changes and request/callback semantics.
crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs Exercise real built Prebid bidder consumption and activity redaction.
docs/guide/integrations/prebid.md Document mode selection, mirror opt-in, publisher ownership and scope.
trusted-server.example.toml Show the default auction mode and opt-in identity setting.
docs/superpowers/specs/2026-11-17-identity-only-tsjs-design.md Define the feature contract and record two spec review rounds.
docs/superpowers/plans/2026-11-17-identity-only-tsjs.md Record implementation and verification steps.

Closes

Closes #1594

Spec

Spec: Identity-only tsjs mode, including two agent review rounds.

Test plan

  • cargo test-fastly && cargo test-fastly-reuse && cargo test-axum && cargo test-cloudflare && cargo test-spin
  • All eight target-matched Clippy aliases
  • cargo fmt --all -- --check
  • JS tests: 3,330 passing; generated bundle build, lint and format checks
  • Docs and repository Markdown format checks
  • Adapter parity tests (29), native build-digest tests (10) and CLI tests
  • Fastly absolute-deadline runtime fixtures (5)
  • URL-host, Wasm clock, CI Node pin, documentation proposal and release producer checks
  • Fastly, Axum and Cloudflare builds; Fastly release WASM build; Cloudflare/Spin auction-deadline fixture builds, lint and local runtimes
  • Browser identity matrix: seven scenarios on each of Fastly and Axum; auction-mode preservation controls on both
  • Deployed Fastly: six controlled provider/persistence scenarios through the actual mirror writer and Prebid bidder consumer

Browser verification exercised the actual Fastly and Axum applications, trusted HTTPS development proxy, real Chrome and a controlled bidder. Seven reader scenarios per adapter cover native capture before any auction, mirror delivery/removal/replacement/expiry/malformed input, metadata precedence, consent denial/restoration and no mirror echo. The controlled reader fixture supplied a generated Prebid 10.26 bundle and synthetic mirror; the application injected and served the changed tsjs normally.

A separate operator-config run used the configured publisher origin and external Prebid bundle, without manual requestBids calls. Automatic native capture was observed on the Fastly homepage and an Axum article; captured IDs matched the native getter and unchanged samples did not rewrite the cookie. Some repeated publisher runs encountered external bundle/origin timeouts or absent third-party identity setup, so these observations do not qualify third-party reliability.

Subsequent deployed Fastly staging verification passed six controlled cookie-provider scenarios: provider input, replacement, opt-out, restoration, and persisted-ID reuse after removing the provider input, carried mirror and native capture cookies. The server reissued the mirror and the actual deployed Prebid bidder consumer received the expected ID without mirror echo. The controlled bidder returned no HTTP requests; these checks do not qualify live vendor APIs, bidder HTTP delivery or other provider kinds. The served shim matched the reviewed build; the backend version header identified the branch rather than an exact commit. Local Viceroy still lacks the JA4 metadata required for normal provider activation, and Axum does not support enabled providers.

Checklist

  • Feature PR: spec linked above, ending in a review log of two or more agent review rounds
  • Changes follow AGENTS.md conventions
  • No unwrap() added in production code
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

@prk-Jr prk-Jr self-assigned this Nov 17, 2026
@prk-Jr prk-Jr linked an issue Nov 18, 2026 that may be closed by this pull request
1 task
@prk-Jr
prk-Jr marked this pull request as ready for review November 18, 2026 07:04
The merge applied without conflicts. The Prebid integration config keeps
this pull request's mode field next to the base's changes, and the
example config, the Prebid guide and the tsjs Prebid sources take both
sides unchanged. The server mirror cookie the identity mode reads is the
same name and envelope in the base, so no code needed to change.
@aram356

aram356 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration chain (#1608), this PR's base #1489 was ported onto #1506's EdgeZero cutover and #1526's async store, so af8da5a28 merges #1489's new head a7262c7db. It merged with no conflicts and no extra edits: the mirror cookie name and envelope (__Host-ts-eids-mirror, {"v":1,...}) are unchanged in the port.

Checked locally at af8da5a28: cargo fmt, all eight clippy aliases and the core build-digest clippy, scripts/lint-wasm-clock.sh, test-fastly, test-fastly-reuse, test-axum (64), test-cloudflare (66), test-spin (89), parity (33), build-digest (10), host CLI tests (972), docs and Markdown format, and the URL-host lint against #1489, all passing (test-fastly 4,064), plus vitest (3,341), JS format and lint, and build-all.mjs.

Takes #1489's new head e4ae9ca, which brings #1506's repin of
EdgeZero to rc/identity at 9d02d7b3. The merge is clean, and this PR's tree
changes only by that repin.
@aram356 aram356 mentioned this pull request Nov 19, 2026
20 of 21 tasks

This branch has not been deployed

No deployments
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.

Identity-only tsjs mode

2 participants