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.
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.
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');
To run the package's tests, use the npm test command:
npm test
If you have any issues with the package, please file an issue on GitHub