Skip to content

adding setBidderConfig #1589

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

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion dev-docs/publisher-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ This page has documentation for the public API methods of Prebid.js.
* [cache](#setConfig-vast-cache)
* [Generic Configuration](#setConfig-Generic-Configuration)
* [Troubleshooting your config](#setConfig-Troubleshooting-your-configuration)
* [.setBidderConfig(options)](#module_pbjs.setBidderConfig)
* [.getConfig([string])](#module_pbjs.getConfig)

Functions added by optional modules
Expand Down Expand Up @@ -1636,7 +1637,7 @@ pbjs.setConfig({
})
{% endhighlight %}

Additional information of these properties:
Additional information of `s2sConfig` properties:

{: .table .table-bordered .table-striped }
| Attribute | Scope | Type | Description |
Expand Down Expand Up @@ -2195,6 +2196,37 @@ If you don't see that message, you can assume the config object is valid.

<hr class="full-rule" />

<a name="module_pbjs.setBidderConfig"></a>

### pbjs.setBidderConfig(options)

This function is similar to [`setConfig`](#module_pbjs.setConfig), but is designed to support certain bidder-specific scenarios.

Configuration provided through the [`setConfig`](#module_pbjs.setConfig) function is
globally available to all bidder adapters. This makes sense because
most of these settings are global in nature. However, there are use cases where different bidders require different data, or where certain parameters apply only to a given
bidder. Use `setBidderConfig` when you need to support these cases.

The page usage is:

{% highlight js %}
pbjs.setBidderConfig({
bidders: ["bidderA"], // one or more bidders
config: { // the bidder-specific config
bidderA: {
customArg: 'value'
}
}
});
{% endhighlight %}

When 'bidderA' calls `getConfig('bidderA')`, it will receive the object that contains 'customArg'.
If any other bidder calls `getConfig('bidderA')`, it will receive nothing.

{: .alert.alert-info :}
The `setBidderConfig` function will soon be used by the `schain` and
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know when "soon" is? Will we remember to revise this note when that happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A couple of weeks. Yes, I plan on remembering to change this note. Of course the memory isn't what it once was.

Copy link
Contributor

Choose a reason for hiding this comment

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

:-) Just wanted to make sure. I've seen a lot of docs that haven't been updated in years that say "new" or "coming soon". Thanks!

`first party data` features.

<a name="module_pbjs.getConfig"></a>

### pbjs.getConfig([string])
Expand Down