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

PBJS: document the NATIVE feature flag for bid adapters #3862

Merged
merged 1 commit into from
Jul 13, 2022
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
7 changes: 4 additions & 3 deletions dev-docs/bidder-adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,8 @@ In order for your bidder to support the native media type:
1. Your (server-side) bidder needs to return a response that contains native assets.
2. Your (client-side) bidder adapter needs to unpack the server's response into a Prebid-compatible bid response populated with the required native assets.
3. Your bidder adapter must be capable of ingesting the required and optional native assets specified on the `adUnit.mediaTypes.native` object, as described in [Show Native Ads](/prebid/native-implementation.html).
4. Your spec must declare NATIVE in the supportedMediaTypes array.
4. Your code, including tests, should check whether native support is enabled (through the global flag `FEATURES.NATIVE`) before doing #2 or #3. This allows users not interested in native to build your adapter without any native-specific code.
5. Your spec must declare NATIVE in the supportedMediaTypes array.

The adapter code samples below fulfills requirement #2, unpacking the server's reponse and:

Expand All @@ -931,7 +932,7 @@ The adapter code samples below fulfills requirement #2, unpacking the server's r
{% highlight js %}

/* Does the bidder respond with native assets? */
else if (rtbBid.rtb.native) {
else if (FEATURES.NATIVE && rtbBid.rtb.native) {

/* If yes, let's populate our response with native assets */

Expand All @@ -958,7 +959,7 @@ Here's an example of returning image sizes:

```javascript
/* Does the bidder respond with native assets? */
else if (rtbBid.rtb.native) {
else if (FEATURES.NATIVE && rtbBid.rtb.native) {

const nativeResponse = rtbBid.rtb.native;

Expand Down