Package Exports
- infr
- infr/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (infr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Infr
Infr is a Node.js wrapper for the Infr API. It provides methods to interact with the Infr API and retrieve ad data. The complete documentation & more packages for the Infr API can be found here.
Installation
Install the package with npm:
npm install infrUsage First, import the InfrDisplayer class from the package:
import { InfrDisplayer } from 'infr';Next, create an instance of InfrDisplayer with your public API key:
const infr = new InfrDisplayer('your-public-key');You can then call the getAd method to retrieve an ad:
const ad = await infr.getAd('A test backdrop');The getAd method returns a Promise that resolves to the ad data.
Development Mode
If you want to use the package in development mode (which will use the test environment and test API key), pass development as the third argument when creating an instance of InfrDisplayer:
// Use the test environment and test API key
// Using `test` will also suffice
const infr = new InfrDisplayer('test');Testing
To run the package's tests, use the npm test command:
npm testIssues
If you have any issues with the package, please file an issue on GitHub