Skip to content

Commit 61fbc04

Browse files
bretgjeanstemp
authored andcommitted
adding setBidderConfig (#1589)
* adding setBidderConfig * minor edits
1 parent f8a6d38 commit 61fbc04

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

dev-docs/publisher-api-reference.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ This page has documentation for the public API methods of Prebid.js.
6262
* [cache](#setConfig-vast-cache)
6363
* [Generic Configuration](#setConfig-Generic-Configuration)
6464
* [Troubleshooting your config](#setConfig-Troubleshooting-your-configuration)
65+
* [.setBidderConfig(options)](#module_pbjs.setBidderConfig)
6566
* [.getConfig([string])](#module_pbjs.getConfig)
6667

6768
Functions added by optional modules
@@ -1636,7 +1637,7 @@ pbjs.setConfig({
16361637
})
16371638
{% endhighlight %}
16381639

1639-
Additional information of these properties:
1640+
Additional information of `s2sConfig` properties:
16401641

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

21962197
<hr class="full-rule" />
21972198

2199+
<a name="module_pbjs.setBidderConfig"></a>
2200+
2201+
### pbjs.setBidderConfig(options)
2202+
2203+
This function is similar to [`setConfig`](#module_pbjs.setConfig), but is designed to support certain bidder-specific scenarios.
2204+
2205+
Configuration provided through the [`setConfig`](#module_pbjs.setConfig) function is
2206+
globally available to all bidder adapters. This makes sense because
2207+
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
2208+
bidder. Use `setBidderConfig` when you need to support these cases.
2209+
2210+
The page usage is:
2211+
2212+
{% highlight js %}
2213+
pbjs.setBidderConfig({
2214+
bidders: ["bidderA"], // one or more bidders
2215+
config: { // the bidder-specific config
2216+
bidderA: {
2217+
customArg: 'value'
2218+
}
2219+
}
2220+
});
2221+
{% endhighlight %}
2222+
2223+
When 'bidderA' calls `getConfig('bidderA')`, it will receive the object that contains 'customArg'.
2224+
If any other bidder calls `getConfig('bidderA')`, it will receive nothing.
2225+
2226+
{: .alert.alert-info :}
2227+
The `setBidderConfig` function will soon be used by the `schain` and
2228+
`first party data` features.
2229+
21982230
<a name="module_pbjs.getConfig"></a>
21992231

22002232
### pbjs.getConfig([string])

0 commit comments

Comments
 (0)