Skip to content

Commit 6f34186

Browse files
authored
RobustApps BId Adapter: initial release (#13572)
* RobustApps Bidder Adapter: basic setup * fix duplicates
1 parent d034772 commit 6f34186

File tree

4 files changed

+518
-4
lines changed

4 files changed

+518
-4
lines changed

libraries/xeUtils/bidderUtils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ export function getBidFloor(bid, currency = 'USD') {
1919
return null;
2020
}
2121

22-
export function isBidRequestValid(bid) {
22+
export function isBidRequestValid(bid, requiredParams = ['pid', 'env']) {
2323
if (bid && typeof bid.params !== 'object') {
2424
logError('Params is not defined or is incorrect in the bidder settings');
2525
return false;
2626
}
2727

28-
if (!getBidIdParameter('env', bid.params) || !getBidIdParameter('pid', bid.params)) {
29-
logError('Env or pid is not present in bidder params');
30-
return false;
28+
for (const param of requiredParams) {
29+
if (!getBidIdParameter(param, bid.params)) {
30+
logError(`Required param "${param}" is missing in bidder params`);
31+
return false;
32+
}
3133
}
3234

3335
if (deepAccess(bid, 'mediaTypes.video') && !isArray(deepAccess(bid, 'mediaTypes.video.playerSize'))) {

modules/robustAppsBidAdapter.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {BANNER, VIDEO} from '../src/mediaTypes.js';
2+
import {registerBidder} from '../src/adapters/bidderFactory.js';
3+
import {buildRequests, getUserSyncs, interpretResponse, isBidRequestValid} from '../libraries/xeUtils/bidderUtils.js';
4+
5+
const BIDDER_CODE = 'robustApps';
6+
const ENDPOINT = 'https://pbjs.rbstsystems.live';
7+
8+
export const spec = {
9+
code: BIDDER_CODE,
10+
supportedMediaTypes: [BANNER, VIDEO],
11+
isBidRequestValid: bid => isBidRequestValid(bid, ['pid']),
12+
buildRequests: (validBidRequests, bidderRequest) => buildRequests(validBidRequests, bidderRequest, ENDPOINT),
13+
interpretResponse,
14+
getUserSyncs
15+
}
16+
17+
registerBidder(spec);

modules/robustAppsBidAdapter.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Overview
2+
3+
```
4+
Module Name: RobustApps Bidder Adapter
5+
Module Type: RobustApps Bidder Adapter
6+
Maintainer: [email protected]
7+
```
8+
9+
# Description
10+
11+
Module that connects to rbstsystems.live demand sources
12+
13+
# Test Parameters
14+
```
15+
var adUnits = [
16+
{
17+
code: 'test-banner',
18+
mediaTypes: {
19+
banner: {
20+
sizes: [[300, 250]],
21+
}
22+
},
23+
bids: [
24+
{
25+
bidder: 'robustApps',
26+
params: {
27+
env: 'robustApps',
28+
pid: 'aa8217e20131c095fe9dba67981040b0',
29+
ext: {}
30+
}
31+
}
32+
]
33+
},
34+
{
35+
code: 'test-video',
36+
sizes: [ [ 640, 480 ] ],
37+
mediaTypes: {
38+
video: {
39+
playerSize: [640, 480],
40+
context: 'instream',
41+
skipppable: true
42+
}
43+
},
44+
bids: [{
45+
bidder: 'robustApps',
46+
params: {
47+
env: 'robustApps',
48+
pid: 'aa8217e20131c095fe9dba67981040b0',
49+
ext: {}
50+
}
51+
}]
52+
}
53+
];
54+
```

0 commit comments

Comments
 (0)