Asterio Bid Adapter: add initial bidder adapter#14691
Conversation
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1c2864ffb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds the initial asterio bidder adapter to Prebid.js, including adapter implementation, documentation, and unit tests.
Changes:
- Introduces
modules/asterioBidAdapter.jswith request building, response interpretation for banner/video, and win tracking. - Adds
modules/asterioBidAdapter.mdbidder documentation and example configuration. - Adds
test/spec/modules/asterioBidAdapter_spec.jsunit tests for request/response mapping and win tracking.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| modules/asterioBidAdapter.js | New bidder adapter implementing validation, request building, response mapping, and win tracking. |
| modules/asterioBidAdapter.md | Initial bidder documentation and test parameters for publishers. |
| test/spec/modules/asterioBidAdapter_spec.js | Unit tests covering adapter validation, request construction, response interpretation, and win tracking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| describe('buildRequests', function () { | ||
| it('should create a POST request to the direct prebid endpoint', function () { | ||
| const bidderRequest = spec.buildRequests([REQUEST], { | ||
| bidderRequestId: '123', | ||
| gdprConsent: { | ||
| gdprApplies: true, | ||
| consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==' | ||
| }, | ||
| refererInfo: { | ||
| page: 'http://test.com/path.html' | ||
| } | ||
| }); | ||
|
|
||
| expect(bidderRequest.method).to.equal('POST'); | ||
| expect(bidderRequest.url).to.equal(ENDPOINT); | ||
| expect(bidderRequest.options.customHeaders).to.deep.equal({ 'Rtb-Direct': true }); | ||
| expect(bidderRequest.options.contentType).to.equal('application/json'); | ||
| expect(bidderRequest.data.requestId).to.equal('123'); | ||
| expect(bidderRequest.data.referer).to.equal('http://test.com/path.html'); | ||
| expect(bidderRequest.data.schain).to.deep.equal(REQUEST.ortb2.source.ext.schain); | ||
| expect(bidderRequest.data.bids).to.deep.equal([{ | ||
| bidId: '456', | ||
| adUnitToken: 'bbd6b4a6-66b8-479d-9527-e17899544693', | ||
| pos: 1, | ||
| sizes: [{ width: 300, height: 250 }, { width: 300, height: 600 }] | ||
| }]); |
There was a problem hiding this comment.
The buildRequests tests only cover bidRequest.sizes as an array of tuples (banner-style). Since the adapter advertises video support and video playerSize can be provided as [w, h] (non-nested), add a unit test that exercises buildRequests for a video adUnit with sizes: [640, 360] (or mediaTypes.video.playerSize: [640, 360]) to ensure size normalization produces a single {width: 640, height: 360} entry.
| # Test Parameters | ||
| ``` | ||
| const adUnits = [ | ||
| { | ||
| bids: [ | ||
| { | ||
| bidder: 'asterio', | ||
| params: { | ||
| adUnitToken: '????????-????-????-????-????????????', // adUnitToken provided by Asterio | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ]; |
There was a problem hiding this comment.
The adapter implementation supports additional bidder params beyond adUnitToken (e.g., pos and an endpoint override), but the module docs only mention adUnitToken. Please document the full set of supported params (required vs optional), and if endpoint override is intended only for testing, explicitly call that out to avoid production misconfiguration.
Coverage Report for CI Build 24175209834Coverage increased (+0.001%) to 96.343%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions3 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
| buildRequests: function (validBidRequests, bidderRequest) { | ||
| const bids = validBidRequests.map(bidRequest => ({ | ||
| bidId: bidRequest.bidId, | ||
| adUnitToken: bidRequest.params.adUnitToken, |
There was a problem hiding this comment.
please define or import type definitions on your bidder params, eg #14773
There was a problem hiding this comment.
Adapter has been migrated to TypeScript
Type of change
Description of change
Adds the initial
asteriobidder adapter for Prebid.js.Features included:
bannerandvideosupportadUnitTokenbidder paramMaintainer contact:
Test parameters:
Other information
Related docs PR: prebid/prebid.github.io#6521