Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

HyperBrainz Bid Adapter: new adapter

Open krishnarx opened this issue 5 months ago • 1 comments

Type of change

  • [x] New bidder adapter

Description of change

Adds the HyperBrainz Bid Adapter, connecting to the HyperBrainz Ad Exchange as a demand source over OpenRTB 2.5. Supports banner, video (instream + outstream), and native media types.

Highlights:

  • Sends ORTB native requests via nativeOrtbRequest and parses native responses into the standard Prebid native.ortb shape
  • Reads first-party data from bidderRequest.ortb2, EIDs from userIdAsEids, supply chain from ortb2.source.ext.schain, and price floors via the floors module (getFloor())
  • Forwards GDPR/TCF, CCPA/USP, GPP and COPPA signals
  • Outstream video renders via a publisher-provided renderer (documented in the adapter .md)
  • Implements user syncs (iframe/pixel) and bid lifecycle handlers (onBidWon, onTimeout, onSetTargeting)

Testing:

  • gulp lint passes with no output
  • Adapter unit tests pass (41 cases): gulp test --file test/spec/modules/hyperbrainzBidAdapter_spec.js
  • Verified end-to-end against the live endpoint: banner renders, native returns native.ortb, and video returns valid VAST (all at cpm 2.5)

Maintainer contact: [email protected]

Test parameters for validating bids:

var adUnits = [
  {
    code: 'test-banner',
    mediaTypes: { banner: { sizes: [[300, 250], [728, 90]] } },
    bids: [{ bidder: 'hyperbrainz', params: { placementId: 'hb_test_banner', bidFloor: 0.30 } }]
  },
  {
    code: 'test-video',
    mediaTypes: { video: { context: 'outstream', playerSize: [640, 360], mimes: ['video/mp4'] } },
    bids: [{ bidder: 'hyperbrainz', params: { placementId: 'hb_test_video' } }]
  },
  {
    code: 'test-native',
    mediaTypes: { native: { ortb: { assets: [
      { id: 1, title: { len: 80 }, required: 1 },
      { id: 2, img: { type: 3, w: 1200, h: 627 }, required: 1 },
      { id: 3, data: { type: 1 } }
    ] } } },
    bids: [{ bidder: 'hyperbrainz', params: { placementId: 'hb_test_native' } }]
  }
];

krishnarx avatar Jun 18 '26 15:06 krishnarx

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!

  • modules/hyperbrainzBidAdapter.js

github-actions[bot] avatar Jun 20 '26 01:06 github-actions[bot]

Hi @jefftmahoney — just checking in on this PR, it's been about 3 weeks since it was assigned for review. I've also just synced the branch with the latest master to keep it up to date and CI is passing (3/3 checks). Let me know if there's anything I can adjust or if it'd help to loop in another reviewer. Happy to make any changes needed!

krishnarx avatar Jul 15 '26 10:07 krishnarx

Hi @krishnarx - sorry for the delay. I will take a look at this.

jefftmahoney avatar Jul 16 '26 02:07 jefftmahoney

This PR includes an adapter whose code does not match its file name. Bid adapter modules should be named <bidderCode>BidAdapter, userId <userIdCode>IdSystem, RTD <rtdCode>RtdProvider, and analytics <analyticsCode>AnalyticsAdapter.

github-actions[bot] avatar Jul 18 '26 11:07 github-actions[bot]

This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:

  • Changes to modules/hyperbrainzBidAdapter.js may need:
    • es.array.push
    • es.iterator.constructor
    • es.iterator.find
    • es.iterator.for-each
    • es.iterator.map
    • es.json.stringify
    • esnext.iterator.constructor
    • esnext.iterator.find
    • esnext.iterator.for-each
    • esnext.iterator.map
    • esnext.json.parse
  • Changes to test/spec/modules/hyperbrainzBidAdapter_spec.js may need:
    • es.array.with
    • es.json.stringify
    • esnext.array.with
    • esnext.json.parse

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

github-actions[bot] avatar Jul 18 '26 11:07 github-actions[bot]

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!

  • modules/hyperbrainzBidAdapter.js

github-actions[bot] avatar Jul 18 '26 11:07 github-actions[bot]

LGTM

Thanks for the approval!

krishnarx avatar Jul 21 '26 05:07 krishnarx

Barecheck - Code coverage report

Total: 96.58%

Your code coverage diff: -0.01% ▾

Uncovered files and lines
FileLines
modules/hyperbrainzBidAdapter.js163, 166, 193-194, 250-251, 279, 290-291, 350, 392, 395, 400-401, 407, 441, 463-464, 480-481, 633-634, 638

barecheck[bot] avatar Jul 25 '26 13:07 barecheck[bot]

Hi @krishnarx

The bidder code hyperbrainz in this bidder adaptor is in use as an alias in adkernelBidAdapter.js since may of 2024 (https://github.com/prebid/Prebid.js/pull/11544)

I need confirmation from your team that I can safely remove it from our bidder adapter without any negative impact on your business.

ckbo3hrk avatar Jul 28 '26 15:07 ckbo3hrk

Hi @krishnarx

The bidder code hyperbrainz in this bidder adaptor is in use as an alias in adkernelBidAdapter.js since may of 2024 (#11544)

I need confirmation from your team that I can safely remove it from our bidder adapter without any negative impact on your business.

Hi @ckbo3hrk — confirmed on our end, that legacy hyperbrainz alias in adkernelBidAdapter.js is dead and carries no live traffic. Please go ahead and remove it — no impact to us. Thanks for flagging it!

krishnarx avatar Jul 28 '26 16:07 krishnarx