@schibstedspain/openads-connector-api

2.0.1 • Public • Published

OpenAds-ConnectorAPI

npm Build status

Compliant interfaces to be implemented to develop an OpenAds connector.

AdViewable

All connectors should implement these methods in order to display Ads:

  • display: Should render an Ad
  • refresh: Should update the Ad's data and render it

AdLoadable

Connectors that support Ad loading without rendering yet (pre-load) should implement these methods:

  • loadAd: Should return the creative data from the Ad server

Load Ad sample

connector.loadAd({
    id: 'ad-1', 
    specification: {
        source: 'appnexus',
        appnexus: {
            keywords: {
                // ...
            },
            invCode: 'listing-top'
        }
    }
})
.then(ad => {
    // ...
})

Display sample

connector.display({id: 'ad-1'})
.then(() => {
    // ...
})

Display sample

connector.refresh({
     id: 'ad-1', 
     specification: {
         source: 'appnexus',
         appnexus: {
             keywords: {
                 // ...
             },
             invCode: 'listing-top-x2'
         }
     }
 })
 .then(ad => {
     // ...
 })

Logger

Connectors that has any Log system integrated, should implement the Logger interface:

  • enableDebug: Should enable or disable the debug tracing for the implementing connector

Readme

Keywords

Package Sidebar

Install

npm i @schibstedspain/openads-connector-api

Weekly Downloads

2

Version

2.0.1

License

ISC

Unpacked Size

7.45 kB

Total Files

7

Last publish

Collaborators

  • schibstedspain