@ironsource/mobile-api-lib-js
v1.1.1
Published
IronSource API implementations for Node.JS
Downloads
13
Readme
IronSourceAPI
Installation
This module is installed via npm:
npm install --save @ironsource/mobile-api-lib-js
Simple Example:
const {IronSource,AppPromotionAPI,MonetizeEnums,AppPromotionEnums} = require('@ironsource/mobile-api-lib-js');
const fs = require('fs');
var ironsource = new IronSource();
ironsource.setCredentials('my_user_name','my_secret_key','my_refresh_token');
//Get Monetization Data
let res = await ironsource.MonetizeAPI().getMonetizationData('2019-11-07','2019-11-20',{adUnit:MonetizeEnums.AdUnits.RewardedVideo,metrics:[MonetizeEnums.Metrics.impressions,MonetizeEnums.Metrics.revenue],breakdowns:[MonetizeEnums.Breakdowns.Date]});
console.log(res.toString());
//Get Advertiser Statistics
let result = await ironsource.PromoteAPI().getAdvertiserStatistics('2019-11-11','2019-12-11',
[AppPromotionEnums.Metrics.Impressions],{format:'csv',breakdowns:[AppPromotionEnums.Breakdowns.Day,
AppPromotionEnums.Breakdowns.Campaign,AppPromotionEnums.Breakdowns.Country,AppPromotionEnums.Breakdowns.Title]});
result.pipe(fs.createWriteStream('./adv.csv'));
#IronSource
Authentication
Before starting to use the API make sure to get the credentials from ironSource dashboard.
And set the Access Key, Secret Key and Refresh Token:
{IronSource} = require('@ironsource/mobile-api-lib-js');
var ironsource = new IronSource();
ironsource.setCredentials('my_user_name','my_secret_key','my_refresh_token');
Modules
Contributing:
Please follow contribution guide