-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
boldwinBidAdapter.js
38 lines (31 loc) · 1.17 KB
/
boldwinBidAdapter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import {
isBidRequestValid,
buildRequestsBase,
interpretResponse,
getUserSyncs,
buildPlacementProcessingFunction,
} from '../libraries/teqblazeUtils/bidderUtils.js';
const BIDDER_CODE = 'boldwin';
const AD_URL = 'https://ssp.videowalldirect.com/pbjs';
const SYNC_URL = 'https://sync.videowalldirect.com';
const addCustomFieldsToPlacement = (bid, bidderRequest, placement) => {
if (placement.adFormat === VIDEO) {
placement.wPlayer = placement.playerSize?.[0]?.[0];
placement.hPlayer = placement.playerSize?.[0]?.[1];
}
};
const placementProcessingFunction = buildPlacementProcessingFunction({ addCustomFieldsToPlacement });
const buildRequests = (validBidRequests = [], bidderRequest = {}) => {
return buildRequestsBase({ adUrl: AD_URL, validBidRequests, bidderRequest, placementProcessingFunction });
};
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
isBidRequestValid: isBidRequestValid(),
buildRequests,
interpretResponse,
getUserSyncs: getUserSyncs(SYNC_URL)
};
registerBidder(spec);