From 4e96a7b15a828e1e1582ea36a969713524f08b12 Mon Sep 17 00:00:00 2001 From: bretg Date: Wed, 6 Dec 2017 15:35:41 -0500 Subject: [PATCH 1/2] Default Endpoints, minor revisions A few suggestions towards making the document easier to understand, and also adding the "default endpoint" section. --- dev-docs/prebid-1.0-API.md | 63 +++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/dev-docs/prebid-1.0-API.md b/dev-docs/prebid-1.0-API.md index 298195e969..f84adfa4a2 100644 --- a/dev-docs/prebid-1.0-API.md +++ b/dev-docs/prebid-1.0-API.md @@ -40,21 +40,17 @@ For a complete list of methods that will be removed, see the [Publisher API Refe -## New API - `pbjs.setConfig` +## Legacy APIs replaced by `pbjs.setConfig` For 1.0, the following APIs will be removed in favor of a generic "options" param object passed to [`pbjs.setConfig`]({{site.baseurl}}/dev-docs/publisher-api-reference.html#module_pbjs.setConfig): -- `pbjs.bidderTimeout` -- `pbjs.logging` (renamed to `debug`) -- `pbjs.publisherDomain` -- `pbjs.cookieSyncDelay` -- `pbjs.setPriceGranularity` -- `pbjs.enableSendAllBids` (behavior will default to `true`) -- `pbjs.setBidderSequence` -- `pbjs.setS2SConfig` -- `pbjs.timeoutBuffer` - -Mapping will be straightforward with the name of the param being the same, except dropping the `set` prefix where appropriate. +- `pbjs.bidderTimeout` - use `pbjs.setConfig({bidderTimeout})` instead +- `pbjs.logging` - use `pbjs.setConfig({debug})` instead +- `pbjs.publisherDomain` - use `pbjs.setConfig({publisherDomain})` instead +- `pbjs.setPriceGranularity` - use `pbjs.setConfig({priceGranularity})` instead +- `pbjs.enableSendAllBids`- use `pbjs.setConfig({enableSendAllBids})` instead. Now defaults to `true`. +- `pbjs.setBidderSequence` - use `pbjs.setConfig({bidderSequence})` instead +- `pbjs.setS2SConfig` - use `pbjs.setConfig({s2sConfig})` instead ### `pbjs.setConfig` Example {:.no_toc} @@ -65,21 +61,38 @@ The input to `pbjs.setConfig` must be JSON (no JavaScript functions are allowed) {% highlight js %} pbjs.setConfig({ - "currency": { - // Enables currency feature -- loads the rate file + currency: { "adServerCurrency": "JPY", - // Allows the publisher to override the default rate file - "conversionRateFile": "url" + "conversionRateFile": "" }, - "debug": true, // Previously `logging` - "s2sConfig": { ... }, - "priceGranularity": "medium", - "enableSendAllBids": false, // Default will be `true` as of 1.0 - "bidderSequence": "random", - "bidderTimeout": 700, // Default for all requests. - "publisherDomain": "abc.com", // Used for SafeFrame creative. - "pageOptions": { ... }, - "sizeConfig": { ... } + debug: true, // Previously `logging` + s2sConfig: { ... }, + priceGranularit": "medium", + enableSendAllBids: false, // Default will be `true` as of 1.0 + bidderSequence: "random", // Default is random + bidderTimeout: 700, // Default for all requests. + publisherDomain: "abc.com", // Used for SafeFrame creative. + pageOptions: { ... }, + sizeConfig: { ... }, + cache: {url: ""} +}); + +{% endhighlight %} + +## No More Default Endpoints + +In Prebid 0.x there were defaults for the Prebid Server endpoints and the video cache URL. With 1.0, these defaults have been removed to be vendor neutral, so all publisher pages must define them via pbjs.setConfig(). The same functionality as 0.x may be achieved with this setConfig: + +{% highlight js %} + +pbjs.setConfig({ + cache: {url: "https://prebid.adnxs.com/pbc/v1/cache"}, + s2sConfig: { + ... + endpoint: "https://prebid.adnxs.com/pbs/v1/auction", + syncEndpoint: "https://prebid.adnxs.com/pbs/v1/cookie_sync", + ... + } }); {% endhighlight %} From 32ea37986cd8578ab5ed0b842e128f3b485112c4 Mon Sep 17 00:00:00 2001 From: bretg Date: Tue, 12 Dec 2017 12:19:14 -0500 Subject: [PATCH 2/2] Update prebid-1.0-API.md --- dev-docs/prebid-1.0-API.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev-docs/prebid-1.0-API.md b/dev-docs/prebid-1.0-API.md index f84adfa4a2..6f2eb44d69 100644 --- a/dev-docs/prebid-1.0-API.md +++ b/dev-docs/prebid-1.0-API.md @@ -67,13 +67,12 @@ pbjs.setConfig({ }, debug: true, // Previously `logging` s2sConfig: { ... }, - priceGranularit": "medium", + priceGranularity: "medium", enableSendAllBids: false, // Default will be `true` as of 1.0 bidderSequence: "random", // Default is random bidderTimeout: 700, // Default for all requests. publisherDomain: "abc.com", // Used for SafeFrame creative. pageOptions: { ... }, - sizeConfig: { ... }, cache: {url: ""} }); @@ -81,7 +80,7 @@ pbjs.setConfig({ ## No More Default Endpoints -In Prebid 0.x there were defaults for the Prebid Server endpoints and the video cache URL. With 1.0, these defaults have been removed to be vendor neutral, so all publisher pages must define them via pbjs.setConfig(). The same functionality as 0.x may be achieved with this setConfig: +In Prebid 0.x there were defaults for the Prebid Server endpoints and the video cache URL. With 1.0, these defaults have been removed to be vendor neutral, so all publisher pages must define them via pbjs.setConfig(). The same functionality as 0.x may be achieved as shown below: {% highlight js %}