{"_id":"@37teams/adbutler","_rev":"1-a59c295d3745dab786849e675848caa8","name":"@37teams/adbutler","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@37teams/adbutler","version":"2.0.0","description":"AdButler API wrapper","keywords":["adbutler","ad serving","api"],"homepage":"https://github.com/adbutler/adbutler-node","author":{"name":"AdButler","email":"support@adbutler.com","url":"https://adbutler.com/"},"contributors":[],"repository":{"type":"git","url":"git://github.com/adbutler/adbutler-node.git"},"bugs:":"https://github.com/adbutler/adbutler-node/issues","engines":{"node":">= v0.10.0"},"main":"lib/adbutler.js","devDependencies":{"chai":"^3.5.0","chai-as-promised":"^6.0.0","mocha":"^3.2.0","sinon":"^1.17.6"},"dependencies":{"bluebird":"^3.4.1","qs":"^6.3.0","request":"^2.72.0"},"license":"MIT","scripts":{"test":"npm install && node_modules/mocha/bin/mocha --opts mocha.opts"},"gitHead":"568d3d36f771fadadc28bf394662995727e07e3e","bugs":{"url":"https://github.com/adbutler/adbutler-node/issues"},"_id":"@37teams/adbutler@2.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.10.1","dist":{"integrity":"sha512-ru/7oUQfWG9HdrzWY6zW0/j2rl5ee0OK+MKjlTXn5AonRgMRbGki1scFh7P4Pv2TlG4UnuT1m4pzhrSaY6asvQ==","shasum":"13535be76cede1b45700f2d846bbb616aff5a5a0","tarball":"https://registry.npmjs.org/@37teams/adbutler/-/adbutler-2.0.0.tgz","fileCount":80,"unpackedSize":56198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSGrxCRA9TVsSAnZWagAApBAP/3jkeDBmPjMtbABDoUWN\nZ2BV64xJzfXPvAmwxaPaO4GnhRbf2Jdj7+/ZZMqrQZQ1OFU4m4D4H9McJMC9\nV4kQjC0xdjHL3FtzLGbnM+VkocxkfCnzu2mVvGbajEI9DNqGbynqCSSN0GLA\nmJins4YrKPDFD4k8B4NQyHoaTQ0Ka5V2aJvQKoAll9DgQfFEt+7KZYR0dSYC\nruZlv59OiX8ul0rzItEOEGyMafoihCOirwApXvpF3bqsXnFJeE+qe0r2+4A3\nN3luJ8AsWx8r4/zOjDkioqfqs9lUnzOIulwpvYFIgReMq1+XfMkeCp4ZF1g+\n4w8RBwSlJcMHvawMFCpQYuqyupOAra57bU3XYfb15MqVM79NPzMWbYXrGnrq\nD6dTJP8qxdjQ0NO3nGXKWfc7EZvozIq0CRDYtzYophyt4P3gvLnDE3eLsral\nxYj6n1vD5cZ0n8ospCe8UywP3ZSOQr8wceM1uxzumLca9cc/OtFSea6/nDGf\nZj/+hsNsXiacrwIv5HmGqPQM9D9nmNyX+I8wYUF3kMn2SHyrosVeAFq0lQbC\nJaWbPn5YdDjoCqqDkVoXWzm/w2mKAllR8Gl9+7hoiE/gsTSI5JAbKeeJQ/T8\nukSVyhn+Z7Q0YdQKLedt4rDWxFA5LiMO70tw2XOOhpw5gNN99VB/QIc5V27r\n32KK\r\n=OVix\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGtSfkLxFsnJvXTemGpnvLBo8PbQ2Texk7Scs275pq2sAiAm9WzeagwmI7ywG5Fk3SK+3c32z5vA//SxgY3K/8lqTg=="}]},"maintainers":[{"name":"mikelindenau","email":"mikelindenau@gmail.com"}],"_npmUser":{"name":"mikelindenau","email":"mikelindenau@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adbutler_2.0.0_1565027056504_0.6168219650226712"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-05T17:44:16.317Z","2.0.0":"2019-08-05T17:44:16.652Z","modified":"2022-04-04T10:44:14.796Z"},"maintainers":[{"name":"mikelindenau","email":"mikelindenau@gmail.com"}],"description":"AdButler API wrapper","homepage":"https://github.com/adbutler/adbutler-node","keywords":["adbutler","ad serving","api"],"repository":{"type":"git","url":"git://github.com/adbutler/adbutler-node.git"},"contributors":[],"author":{"name":"AdButler","email":"support@adbutler.com","url":"https://adbutler.com/"},"bugs":{"url":"https://github.com/adbutler/adbutler-node/issues"},"license":"MIT","readme":"# AdButler node.js bindings\n\n[![Build Status](https://travis-ci.org/adbutler/adbutler-node.svg?branch=master)](https://travis-ci.org/adbutler/adbutler-node)\n\nThese bindings are intended for use on the server side because they deal with\nsecret keys explicitly.\nDO NOT use them in the browser.\n\n## Installation\nInstall using the following NPM command:\n\n`npm install --save adbutler`\n\nThis will save the AdButler dependency in `package.json`.\n\n## Usage\n\nThe first step is to load the library by requiring it.\n\n```js\nvar AdButler = require('adbutler');\n```\n\nNext, create an `adButler` instance.\nYou can pass in your secret API key in the configuration object as shown below.\n\n```js\nvar adButler = new AdButler({\n    'apiKey': 'YOUR_API_KEY'\n})\n```\n\nEvery resource can be accessed via the `adButler` instance and supports `create`,\n`read`, `update`, `delete`, and `list` operations.\nThe library supports callback based and promise based usage.\nPick the programming style you like.\nA brief overview of both follows.\n\n### Callback based usage\nEvery resource method accepts a callback function as the last argument.\nFollowing [Node.js](https://nodejs.org/en/) convention, the error object is\nalways passed as the first argument to the callback function, and is `null` if\nno error occurred.\nHere is a simple example.\n\n```js\nadButler.advertisers.read(123, function(error, data) {\n  // error is null on success\n  if (error) {\n\tconsole.log(error); // some error occurred\n  } else {\n\tconsole.log(data); // the response data\n  }\n});\n```\n\n### Promise based usage\nEvery resource method returns a promise if no callback function is given.\n\n```js\n// Create a new media group\nadButler.mediaGroups.create({\n  \"name\": \"Demo Media Group\"\n}).then(function(mediaGroup) {\n  // Create a new image creative\n  return adButler.creatives.image.create({\n\t'file': 'image-ad.png', // this file must exist where the script is executed\n\t'group': mediaGroup.id,\n\t'name': 'My Image Creative',\n\t'description': 'This is a description of my image creative.'\n  });\n}).then(function(imageCreative){\n  // Create a new image banner\n  return adButler.banners.image.create({\n\t'name': 'My Image Banner',\n\t'width': 300,\n\t'height': 250,\n\t'creative': imageCreative.id\n  });\n}).then(function(imageBanner) {\n  // New image banner created in a new media group\n}).catch(function(error) {\n  // Deal with the error\n});\n```\n\n## Configuration\n\n * `adButler.set('apiKey', 'your_SECRET_api_key ');`\n * `adButler.set('timeout', 20000); // in ms` (default is node's default: `120000ms`)\n \n## Documentation\nSee our [detailed API documentation](http://adbutler.com/docs/api/?node).\n\n## Development\n\nRun the tests using [`npm`](https://www.npmjs.com/):\n\n```bash\n$ npm install\n$ npm test\n```\n\nIf you wish, you may run tests using your AdButler *Test* API key by setting\nthe environment variable `ADBUTLER_TEST_API_KEY` before running tests:\n\n```bash\n$ export ADBUTLER_TEST_API_KEY='your_api_key'\n$ npm test\n```\n\n*Note: On Windows use `SET` instead of `export` for setting the\n`ADBUTLER_TEST_API_KEY` environment variable.*\n\n## License\n© 2016–2017 SparkLIT. Released under the MIT license.\n","readmeFilename":"README.md"}