Expose Fastly geo data to replace third-party lookups #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Third-party geo and DMA lookups add avoidable latency and introduce additional privacy and compliance risk. This change enables geo information to be derived from Fastly at the edge and passed through the Trusted Server instead of relying on browser-side APIs.
Centralizing geo handling reduces external dependencies, improves reliability when third-party services fail, and supports ongoing efforts to minimize client-side data exposure while preserving existing ad and bidding functionality.
Technical Implementation
To reliably pass server-side Geo signals to the client-side Prebid auction without race conditions or additional network calls, this PR refactors the Prebid integration to be configuration-driven:
Geo Injection
Decoupled Geo logic into a standalone module:
crates/common/src/geo.rsx-geo-*headers/first-party/geoendpointConfiguration Injection
Refactored
PrebidHtmlInjector:crates/common/src/integrations/prebid.rsInjects the entire Prebid configuration (including resolved Geo data) into:
Synchronization
Updated the
tsjsclient library:crates/js/lib/src/integrations/prebid/index.tsResolves: #280