infr
v1.0.6
Published
Node wrapper for the Infr API
Downloads
3
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 infr
Usage 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 test
Issues
If you have any issues with the package, please file an issue on GitHub