Skip to content

HyperBrainz Bid Adapter: new adapter - #15405

Open
krishnarx wants to merge 15 commits into
prebid:masterfrom
hyperbrainz:hyperbrainz-bid-adapter-agent
Open

HyperBrainz Bid Adapter: new adapter#15405
krishnarx wants to merge 15 commits into
prebid:masterfrom
hyperbrainz:hyperbrainz-bid-adapter-agent

Conversation

@krishnarx

Copy link
Copy Markdown
Contributor

Type of change

  • New bidder adapter

Description of change

Resubmission of #15137, which was merged and then reverted in #15401
due to a build failure also fixed a bug where the adapter incorrectly used
the win-notification URL (nurl) as the video ad source instead of the
actual VAST content (adm/vastXml). This was causing video ads to fail
with a "no MediaFile URL found" error even on valid bids.

The Adkernel alias conflict raised in #15137 has also been discussed
with @ckbo3hrk (see #11544 / #15137) — the hyperbrainz alias in
adkernelBidAdapter.js is unused on our side and confirmed safe to
remove.

Other information

Related docs PR: prebid/prebid.github.io#6632

Maintainer contact: it@hyperbrainz.com

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' } }]
  }
];

@github-actions

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

@review-assignment-bot
review-assignment-bot Bot requested a review from lksharma July 28, 2026 21:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3096095243

ℹ️ 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".

function buildSource(bidderRequest) {
return {
fd: 1,
tid: bidderRequest?.ortb2?.source?.tid || generateUUID(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Respect enableTIDs before adding source.tid

When publishers leave enableTIDs at its default false, Prebid redacts ortb2.source.tid before adapter code runs; this fallback immediately generates a new source.tid anyway, so every HyperBrainz request still transmits a bidder-created auction transaction ID despite the privacy control. The repo-enforced module rules prohibit bidder-created TIDs, so omit source.tid unless Prebid supplied one.

Useful? React with 👍 / 👎.

}

export const spec = {
code: BIDDER_CODE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove stale HyperBrainz alias before registering code

When a build includes both adkernelBidAdapter and this new adapter, modules/adkernelBidAdapter.js still registers { code: 'hyperbrainz' } as an alias of adkernel; registering this spec under the same bidder code leaves aliasRegistry.hyperbrainz resolving to Adkernel and can also let import order decide which adapter owns bidderRegistry.hyperbrainz, so HyperBrainz bids can be routed or attributed incorrectly. Remove the old alias before adding this bidder code.

Useful? React with 👍 / 👎.

const map = {};

validBids.forEach((bid) => {
const ep = bid.params.endpoint || defaultEndpoint;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Constrain custom endpoints to HyperBrainz domains

Because this accepts bid.params.endpoint verbatim, any page config can make the adapter POST the full auction payload, consent strings, EIDs, and first-party data to an arbitrary URL; the repo asks reviews to enforce the module rule that endpoint domains cannot be fully variable. Please restrict overrides to approved HyperBrainz hosts or remove the per-bid endpoint override.

Useful? React with 👍 / 👎.

@barecheck

barecheck Bot commented Jul 28, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.66%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
modules/hyperbrainzBidAdapter.js163, 166, 193-194, 249-250, 278, 289-290, 349, 391, 394, 399-400, 406, 440, 462-463, 479-480, 632-633, 637

@patmmccann

patmmccann commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

You need to also commit a d.ts file or convert your Js to ts. Also modify adkernal to remove the alias

@krishnarx

Copy link
Copy Markdown
Contributor Author

Hi @ckbo3hrk — following up on the alias question from #15137. Since we confirmed the hyperbrainz alias in adkernelBidAdapter.js is unused on our side and safe to remove, could you go ahead and remove it? Patrick has flagged this as a blocker for getting our new adapter (#15405) merged. Let me know once it's done or if you need anything else from us.

@patmmccann

patmmccann commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

@krishnarx the alias is fixed, we still need types on your params eg #14918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants