Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid Server Bid Adapter : Support for custom headers for XHR call #11780

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

sanved77
Copy link
Contributor

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

This PR introduces the capability to include custom headers in the XHR calls made to the Prebid Server bid adapter endpoint. By adding custom headers to the s2sConfig under the customHeader object, users can ensure that these headers are sent with the requests.

Usage

// If only one server config is given

pbjs.setConfig({
  s2sConfig: {
    endpoint: 'https://prebid-server.example.com/bid',
    customHeader: {
      'Custom-Header': 'value'
    }
  }
});
// If multiple servers, then something like this

pbjs.setConfig({
    s2sConfig: [
        {
            name: "pbs-appnexus",
            customHeader: {
                'Authorization': 'Bearer token-appnexus',
                'Appnexus-Custom-Header': 'value-appnexus'
            }
        },
        {
            name: "pbs-rubicon",
            customHeader: {
                'Authorization': 'Bearer token-rubicon',
                'Rubicon-Custom-Header': 'value-rubicon'
            }
        },
    ],
});

@patmmccann
Copy link
Collaborator

Please make a docs pr. Thanks for the new feature!

@patmmccann patmmccann added the needs 2nd review Core module updates require two approvals from the core team label Jun 18, 2024
@patmmccann patmmccann removed their assignment Jun 18, 2024
@sanved77
Copy link
Contributor Author

Please make a docs pr. Thanks for the new feature!

You're welcome. Will add the docs PR

@sanved77
Copy link
Contributor Author

@patmmccann
Doc PR added as well - prebid/prebid.github.io#5444

@patmmccann
Copy link
Collaborator

@bretg tagging you for input

Copy link
Collaborator

@bretg bretg left a comment

Choose a reason for hiding this comment

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

Seems ok to me. I'm not signing off on the code, just the concept.

@patmmccann patmmccann merged commit 9dc08c5 into prebid:master Jun 20, 2024
5 checks passed
DecayConstant pushed a commit to mediavine/Prebid.js that referenced this pull request Jul 18, 2024
…rebid#11780)

* merge fix

* Adding support for custom headers for prebid server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature needs docs needs 2nd review Core module updates require two approvals from the core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants