modules/prebidServerBidAdapter/index.js
function setS2sConfig(options) {
  if (options.defaultVendor) {
    let vendor = options.defaultVendor;
    let optionKeys = Object.keys(options);
    if (S2S_VENDORS[vendor]) {
      // vendor keys will be set if either: the key was not specified by user
      // or if the user did not set their own distinct value (ie using the system default) to override the vendor
      Object.keys(S2S_VENDORS[vendor]).forEach((vendorKey) => {
        if (s2sDefaultConfig[vendorKey] === options[vendorKey] || !includes(optionKeys, vendorKey)) {
          options[vendorKey] = S2S_VENDORS[vendor][vendorKey];
        }
      });
    } else {
      utils.logError('Incorrect or unavailable prebid server default vendor option: ' + vendor);
      return false;
    }
  }

  let keys = Object.keys(options);

  if (['accountId', 'bidders', 'endpoint'].filter(key => {
    if (!includes(keys, key)) {
      utils.logError(key + ' missing in server to server config');
      return true;
    }
    return false;
  }).length > 0) {
    return;
  }

  _s2sConfig = options;
}
function setS2sConfig(options) {
  if (options.defaultVendor) {
    let vendor = options.defaultVendor;
    let optionKeys = Object.keys(options);
    if (S2S_VENDORS[vendor]) {
      // vendor keys will be set if either: the key was not specified by user
      // or if the user did not set their own distinct value (ie using the system default) to override the vendor
      Object.keys(S2S_VENDORS[vendor]).forEach((vendorKey) => {
        if (s2sDefaultConfig[vendorKey] === options[vendorKey] || !includes(optionKeys, vendorKey)) {
          options[vendorKey] = S2S_VENDORS[vendor][vendorKey];
        }
      });
    } else {
      utils.logError('Incorrect or unavailable prebid server default vendor option: ' + vendor);
      return false;
    }
  }

  let keys = Object.keys(options);

  if (['accountId', 'bidders', 'endpoint'].filter(key => {
    if (!includes(keys, key)) {
      utils.logError(key + ' missing in server to server config');
      return true;
    }
    return false;
  }).length > 0) {
    return;
  }

  _s2sConfig = options;
}
function setS2sConfig ( options ) { if ( options . defaultVendor ) { let vendor = options . defaultVendor ; let optionKeys = Object . keys ( options ) ; if ( S2S_VENDORS [ vendor ] ) { // vendor keys will be set if either: the key was not specified by user // or if the user did not set their own distinct value (ie using the system default) to override the vendor Object . keys ( S2S_VENDORS [ vendor ] ) . forEach ( ( vendorKey ) => { if ( s2sDefaultConfig [ vendorKey ] === options [ vendorKey ] || ! includes ( optionKeys , vendorKey ) ) { options [ vendorKey ] = S2S_VENDORS [ vendor ] [ vendorKey ] ; } } ) ; } else { utils . logError ( 'Incorrect or unavailable prebid server default vendor option: ' + vendor ) ; return false ; } } let keys = Object . keys ( options ) ; if ( [ 'accountId' , 'bidders' , 'endpoint' ] . filter ( key => { if ( ! includes ( keys , key ) ) { utils . logError ( key + ' missing in server to server config' ) ; return true ; } return false ; } ) . length > 0 ) { return ; } _s2sConfig = options ; }
Set config for server to server header bidding
@typedef {Object} options - required
@property {boolean} enabled enables S2S bidding
@property {string[]} bidders bidders to request S2S
@property {string} endpoint endpoint to contact
=== optional params below ===
@property {number} [timeout] timeout for S2S bidders - should be lower than `pbjs.requestBids({timeout})`
@property {boolean} [cacheMarkup] whether to cache the adm result
@property {string} [adapter] adapter code to use for S2S
@property {string} [syncEndpoint] endpoint URL for syncing cookies
@property {Object} [extPrebid] properties will be merged into request.ext.prebid
@property {AdapterOptions} [adapterOptions] adds arguments to resulting OpenRTB payload to Prebid Server
Set config for server to server header bidding