{"_id":"@afuggini/node-google-dfp","_rev":"1-dd56621db2a7e174fbbc548cd7054388","name":"@afuggini/node-google-dfp","dist-tags":{"latest":"0.4.0"},"versions":{"0.4.0":{"name":"@afuggini/node-google-dfp","version":"0.4.0","description":"Google DFP API Helper Library for NodeJS","main":"index.js","devDependencies":{"grunt":"^1.0.0","grunt-contrib-jshint":"^1.0.0","grunt-jasmine-node":"^0.3.1","jasmine-node":"^2.0.1"},"dependencies":{"google-auth-library":"^2.0.0","soap":"^0.25.0"},"scripts":{"test":"grunt all"},"author":{"name":"Ariel Fuggini"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/afuggini/node-google-dfp.git"},"bugs":{"url":"https://github.com/afuggini/node-google-dfp/issues"},"homepage":"https://github.com/afuggini/node-google-dfp","keywords":["Google","DFP","DoubleClick","adserver"],"gitHead":"b84e1ea41d5f1f33c2451692d66aadd0255f255a","_id":"@afuggini/node-google-dfp@0.4.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"afuggini","email":"ariel@southernmedia.net"},"dist":{"integrity":"sha512-KjjEdQSlXSI7SK25WNXog+7D5yce8Ims0N3TIrALVFMayy8ZrDU+CEEHDbJUJnTxmryjPA2+0w5xw7n+GWw2IQ==","shasum":"472d0d994750da11ac08268ba60b0cd7ee8f42b6","tarball":"https://registry.npmjs.org/@afuggini/node-google-dfp/-/node-google-dfp-0.4.0.tgz","fileCount":18,"unpackedSize":28609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOl6eCRA9TVsSAnZWagAAYZUP/i0G7rjqnKuJ4NqXpbZp\n1JDZ8b/3OdvOpBGZjTgMx1EEuUxCjSrZi6W353rOhE/44kc+RX+q8kpYs5F7\njO2MPpF6VP0CTRbCYY15MzC/MWXGtvJokr9Xr4PkS3Mxhcst3NFEZGdfvlf+\nO7/0e6uqsZd6afxKbo5Wuuwxqs50Rdl5zGZ/fc1O3zrUqQTyDCVS0zhJRysL\nmInrwWht5xdUvSBm6GfkiREsprakhig2zPHSCEmH797QbaXOCMIg8wu5sIH5\nByqwtlUM3/mENH6SCAnPydumdgiqIiDMlY/De54ilJnfP7GQ6e62GzGUewbg\nWnRCbpRWSuvY6ZuWfJw82DDTSuH9uuqsmFUBhIy/usn5gAIvKz+7yG/V7UsL\n8Y3zSOgQsgy5Mr4q18Q3iitxqzDg0lgqGeq4l+6+cVmLyUV9zI4sMhaQJUtf\n1s/SODdtaodsAj7lYpsBgyzNd1BwOKvOqvRy3UK1Wk9dnEjl7W8BHL0NjGCz\nthrxzbC9v3AtzhVVtyRifNgMZ61a+nM2DtDR+z3/P/Q6Io79kMvvvUE2vK92\n8zSg44hmQCRimwvf3qAgqaCWKSdYdjuLZx9/vegnhyCbjr5jBFyq/hMR9Ylf\nMLzvxmImf8ZMMl1l5H0erYlbUxTUvOmwOf53ySkhoLyKzkkZMxHEhCggOgN1\njk6K\r\n=VpyR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8qI7gqdgo9uDA1HmLj9n8YU6BwPmnvOLtH/Yl7N3C2gIgEuFHM0v3T8tOyHWK2DwtCBK4jgGxdiLKbkZiMlIZolE="}]},"maintainers":[{"name":"afuggini","email":"ariel@southernmedia.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-google-dfp_0.4.0_1547329181996_0.04787706183005658"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-12T21:39:41.811Z","0.4.0":"2019-01-12T21:39:42.141Z","modified":"2022-04-04T11:52:51.409Z"},"maintainers":[{"name":"afuggini","email":"ariel@southernmedia.net"}],"description":"Google DFP API Helper Library for NodeJS","homepage":"https://github.com/afuggini/node-google-dfp","keywords":["Google","DFP","DoubleClick","adserver"],"repository":{"type":"git","url":"git+https://github.com/afuggini/node-google-dfp.git"},"author":{"name":"Ariel Fuggini"},"bugs":{"url":"https://github.com/afuggini/node-google-dfp/issues"},"license":"ISC","readme":"[![Code Climate](https://codeclimate.com/github/ShinyAds/node-google-dfp/badges/gpa.svg)](https://codeclimate.com/github/ShinyAds/node-google-dfp) [![Test Coverage](https://codeclimate.com/github/ShinyAds/node-google-dfp/badges/coverage.svg)](https://codeclimate.com/github/ShinyAds/node-google-dfp/coverage) [![Build Status](https://travis-ci.org/ShinyAds/node-google-dfp.svg?branch=master)](https://travis-ci.org/ShinyAds/node-google-dfp)\n# Google DFP API Client for NodeJS\n\n## Basics\n\nInitialize the DFP Instance.\n\n```JavaScript\nvar Dfp = require('node-google-dfp'),\n    dfpUser = new Dfp.User(NETWORK_CODE, APP_NAME, VERSION);\n```\n\nNext, setup your client settings and your user's OAUTH token information.\n\n```JavaScript\ndfpUser.setSettings({\n  client_id : \"YOUR CLIENT ID\",\n  client_secret : \"YOUR CLIENT SECRET\",\n  refresh_token : \"A REFRESH TOKEN\",\n  redirect_url : \"YOUR OAUTH REDIRECT URL\"\n});\n```\n\nYou can instance any of DFP's API Services; https://developers.google.com/doubleclick-publishers/docs/start\n\n\n```JavaScript\ndfpUser.getService('LineItemService', function (err, lineItemService) {\n  if (err) {\n    return console.error(err);\n  }\n\n  var statement = new DfpClass.Statement('WHERE id = 103207340');\n\n  lineItemService.getLineItemsByStatement(statement, function (err, results) {\n    console.log(results);\n  });\n\n});\n```\n\n### Service accounts example\n\nIf you would like to use a Google [Service Account](https://developers.google.com/doubleclick-publishers/docs/service_accounts) to access DFP, you can do so by creating an instance of the JWT auth client.\n\n```JavaScript\nvar {JWT} = require('google-auth-library')\n\nvar jwtClient = new JWT(\n  SERVICE_ACCOUNT_EMAIL,\n  'path/to/key.pem',\n  null,\n  ['https://www.googleapis.com/auth/dfp']);\n\ndfpUser.setClient(jwtClient)\n\n```\n\n=======\n### oAuth setup\n\nThis application requires a working oAuth refresh token to make requests. If you don't include a refresh token you will get an \"No refresh token is set\" error. If you include a bad token, you'll get an \"illegal access\" error. Service accounts are not supported.\n\nTo setup a refresh token manually, follow [Google's instructions](https://developers.google.com/accounts/docs/OAuth2ForDevices#obtainingatoken) for using cURL. The main steps are included below.\n\n*  Setup a oAuth \"installed application\" in the Google Developer Console.\n\n* Create a verification request using this installed application's client ID. (If you miss this step you'll get an `authorization_pending` error from Google on the next step.) Note that any slashes in a `device_code` will need to be escaped.\n\n```curl -d \"client_id={YOUR_OAUTH_CLIENT_ID}&scope=https://www.googleapis.com/auth/dfp\" https://accounts.google.com/o/oauth2/device/code```\n\n    {\n      \"device_code\" : \"ABCD-EFGH4/MEiMYvOO1THXLV_fHGGN8obAgb5XFs1Uctj-QsyYsQk\",\n      \"user_code\" : \"ABCD-EFGH\",\n      \"verification_url\" : \"https://www.google.com/device\",\n      \"expires_in\" : 1800,\n      \"interval\" : 5\n    }\n\n\n* Visit the `verification_url` contained in the verification request response (e.g. https://www.google.com/device) in a browser and type in the `user_code` provided in the verification response. A verification code will be given as a response.\n\n* Use the provided `code` and your client ID and secret from the Google oAuth application to create a refresh token.\n\n```curl -d \"client_id={YOUR_OAUTH_CLIENT_ID}&client_secret={YOUR_OAUTH_CLIENT_SECRET}&code={YOUR_VERIFICATION_CODE}&grant_type=http://oauth.net/grant_type/device/1.0\" https://accounts.google.com/o/oauth2/token```\n\n    {\n      \"access_token\" : \"ya29.JAHynQpVpjBFhvg-7VKdQ7nmD0DkmCYoWTWo535TP8QsKa6j2rFOI1i0pdclFepv_GZo9A2SrN41dA\",\n      \"token_type\" : \"Bearer\",\n      \"expires_in\" : 3600,\n      \"id_token\" : \"eyJhbGciOiJSUzI1NiIsImtpZCI6IjdjZmM3YTJhMDkwYWJjOGYxMDU5MjJmMzFiN2FjZGUzYzA2NmU1NTYifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiaWQiOiIxMTU2MjQxNzA0MjQ3NzA5NDYzNzgiLCJzdWIiOiIxMTU2MjQxNzA0MjQ3NzA5NDYzNzgiLCJhenAiOiI4MzQ3MDQ2OTI1ODItMzlwY3I2M2RmNjBlZjByY2E5ZTc1cDRicTlzbjhxOWUuYXBwcy5nb29nbyV1c2VyY29udGVudC5jb20iLCJlbWFpbCI6InRheWxvci5idWxleUBtY25hdWdodG9uLm1lZGlhIiwiYXRfaGFzaCI6Ikp2Sl9JUDlxUk9zX1JUNDBoY0FSWVEiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXVkIjoiODM0NzA0HjkyNTgyLTM5cGNyNjNkZjYwZWYwcmNhOWU3NXA0YnE5c244cTllLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiaGQiOiJtY25hdWdodG9uLm1lZGlhIiwidG9rZW5faGFzaCI6Ikp2Sl9JSDlxUk9zX1JUNDBoY0FSWVEiLCJ2ZXJpZmllZF9lbWFpbCI6dHJ1ZSwiY2lkIjoiODM0NzA0NjkyNTgyLTM5cGNyNjNkZjYwZWYwcmNhOWU3NXA0YnE5c244cTllLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiaWF0IjoxNDI0ODAwNDcwLCJleHAiOjE0MjQ4MDQzNzB9.T9mTcSl5bJLKrFhldXOd1L1CnGFfZHNF1eQOmJYyp7wR3vKbz8ATTNAfyo8_2hSGt9kGrHDBcdgaq_18RYS72Tt0MclNy020romjl6rYRjs6GH93S3ZMiwra3UI3kmDXym9kyntedMS5gIPgJWfcoh0J0CTDNPBisLNrZntJv7Y\",\n      \"refresh_token\" : \"1/CGpCHgTgJ28PMnh84PgQBOgHHHaLCDbDQ_0ZiINmO_g\"\n    }\n\nYou can use `urn:ietf:wg:oauth:2.0:oob` for the redirect URL of non-public apps.\n\nKnown Issues\n------------\n\n1. OAuth Support for more than just Refresh Token\n2. No unit tests\n\n\nHow to contribute\n-----------\n\nFollow Github's [recommended workflow](https://help.github.com/articles/fork-a-repo) for contributing to this project.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b your-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin your-new-feature`)\n5. Create new Pull Request\n","readmeFilename":"README.md"}