Techdocs

AMP Web SDK

AMP player

Prebid

Prebid

new Prebid(player, configopt, key)

Creates an instance of the Prebid plugin.

Parameters
Name Type Attributes Description
player akamai.amp.Player

The player instance

config akamai.amp.prebid.PrebidConfig | Object <optional>

The configuration override object, or JSON string.

key string

The plugin identifier.

Members

PREBID_REQUEST_TIMEOUT

(static) :number

Default timeout value for prebid request method.

Default Value:
  • 1000
See:
  • {akamai.amp.prebid.PrebidConfig#timeout}

adUnitCodes

:Array.<String>

List of prebid adUnit codes provided along with plugin config.

plugin

:Object

The pbjs namespace, this should be passed through resources node or needs to be available in the DOM as window.pbjs

Methods

getAdTag

getAdTag() → {Promise.<string>}

Request and processes the bid response from sendRequest method.

Returns
Promise.<string>

getAdTagFromBid

getAdTagFromBid(bids) → {string}

Returns vast Url from the highest CPM bid.

Parameters
Name Type Description
bids Array.<Object>

The bids response from prebid auctions.

Returns
string

getAdTagFromServer

getAdTagFromServer(bids) → {string}

Returns ad tag url with each bid key value pair.

Parameters
Name Type Description
bids Array.<Object>

The bids response from prebid auctions.

Returns
string

sendRequest

sendRequest() → {Promise.<Array>}

Send a bid request through pbjs requestBids method. It returns an array of bids.

Returns
Promise.<Array>