{"_id":"@20minutes/node-google-dfp","_rev":"4-fa8ab7d3e37eca154891f9f8c641a56b","name":"@20minutes/node-google-dfp","dist-tags":{"latest":"0.5.0"},"versions":{"0.4.0":{"name":"@20minutes/node-google-dfp","version":"0.4.0","keywords":["Google","DFP","DoubleClick","adserver"],"author":{"name":"ShinyAds"},"license":"ISC","_id":"@20minutes/node-google-dfp@0.4.0","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"contributors":[{"name":"Andre de Souza","email":"ajsouz@gmail.com"},{"name":"Gregory Pike","email":"greg@gregpike.ca"}],"homepage":"https://github.com/20minutes/node-google-dfp","dist":{"shasum":"b0c98d50a4bd38574a98822863561309e2e5cff7","tarball":"https://registry.npmjs.org/@20minutes/node-google-dfp/-/node-google-dfp-0.4.0.tgz","fileCount":9,"integrity":"sha512-A409IMNHA7GyQptq1EnLIbX4groVFt4u5Kq8meWFDczUJW+ZspjB7L8g9atxkxfu9JlF+fam3zeTxGZerRaQWg==","signatures":[{"sig":"MEUCIQDUb61K6YQjr6J2bqzPl700J18W3Kz77hqdeUF7CZXLtgIgKa++ct9Fxhz8jYxfc09hU+mwkrvpEphOmn4sn/zC8s8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlhUHCRA9TVsSAnZWagAAsMIQAIfKfDrdnfqbHosj/EhD\nlDTuL5nBmibx6LPLVPCIs6ELgbzlDBL/pNMoVoRdi/tMvHUoKBIH/dQSR709\nfwuhAHeSKKpKqE/C2h9t4tGAfvgBX2tcMplWLrt2qtGhTAFXD5UJIsqHCYwt\n9s5wdz/MyUZDMiLFMVrqwFQiLdM9Z03xuO/x3LPfV6W4ltQo+n9Ttv5CdJAD\nWVKM5t/Xl7BpHZywUepMi4025I9cn45lA7sCx37z2NfKTN0aJ1tLyDxg7/4c\nyYjpoefY3o9EA3IeIGr8PBDudNQ1pMCWNLlCWGY9YwhltB6WVMtjTM1lUiHL\nIWcEnZmL5OAzHF2gEgFwHCu3kKhJposjUUwnGWAvlIIDomI3iqez6ERFMLce\nVKJWsHzwp2mbmuX0/3FJFkOPygtZVVRtFQqPnLA5PFiNTOhQRHdIZPWL3ryS\nfXUNnKIVPf7XSrKyfuKpl3wT/3BFTs9D2gMB1v7+ZhIVo2ipBF15gl6FBXQB\n17tdDL+DDm2sTNM03zHFt0+QDfvj4RdJB5bnNddCh21qX9cwhJ8novotjbIp\nom6Wjq+pPJqdfBxmPGJFJpsn7kekqED5zIP+bF8ipoV3OKqQJItCSqILE4DH\nQbA1CuyrIDOKhagzBjld2+7WTGmPDwTCfUVd7qD9r5MwTEwwhHtcaI7SkZYq\nB44z\r\n=klyz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","scripts":{"lint":"grunt lint","test":"grunt all"},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"repository":{"url":"https://github.com/20minutes/node-google-dfp.git","type":"git"},"description":"Google DFP API Helper Library for NodeJS","directories":{},"licenseText":"Copyright (c) 2014, Shiny Ads <info@shinyads.com>\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.","dependencies":{"soap":"^0.43.0","google-auth-library":"^7.10.2"},"_hasShrinkwrap":false,"devDependencies":{"grunt":"^1.0.4","jasmine-node":"^3.0.0","grunt-jasmine-node":"^0.3.1","grunt-contrib-jshint":"^3.1.1"},"_npmOperationalInternal":{"tmp":"tmp/node-google-dfp_0.4.0_1637225735170_0.7645857645518226","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.5.0":{"name":"@20minutes/node-google-dfp","version":"0.5.0","keywords":["Google","DFP","DoubleClick","adserver"],"author":{"name":"ShinyAds"},"license":"ISC","_id":"@20minutes/node-google-dfp@0.5.0","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"contributors":[{"name":"Andre de Souza","email":"ajsouz@gmail.com"},{"name":"Gregory Pike","email":"greg@gregpike.ca"}],"homepage":"https://github.com/20minutes/node-google-dfp","dist":{"shasum":"3cc11c64e6cd78a518a8de5d0d2633a72f64f27c","tarball":"https://registry.npmjs.org/@20minutes/node-google-dfp/-/node-google-dfp-0.5.0.tgz","fileCount":9,"integrity":"sha512-/ZO8oE1gYbMxfDwuj51ZWliVIwrgVLDVCISWSLLvn/0sDQfQoU8dcTgHu4RAJFGnPdK2FY79ogmMu5eOC3Rt8g==","signatures":[{"sig":"MEQCIFDd3+Gn2E0HyaHlyhYFYeWGL2/EtS0Bb8cobvYFzOXCAiAv7Ty61S+l0IiE9p8R9P+jMSRD6Wlbhbc/pK1jiAaHdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11864},"main":"index.js","scripts":{"lint":"grunt lint","test":"grunt all"},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"repository":{"url":"https://github.com/20minutes/node-google-dfp.git","type":"git"},"description":"Google DFP API Helper Library for NodeJS","directories":{},"licenseText":"Copyright (c) 2014, Shiny Ads <info@shinyads.com>\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.","dependencies":{"soap":"^1.0.0","google-auth-library":"^8.8.0"},"_hasShrinkwrap":false,"devDependencies":{"grunt":"^1.0.4","jasmine-node":"^3.0.0","grunt-jasmine-node":"^0.3.1","grunt-contrib-jshint":"^3.1.1"},"_npmOperationalInternal":{"tmp":"tmp/node-google-dfp_0.5.0_1683646386619_0.46800887455770024","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2021-11-18T08:55:35.087Z","modified":"2025-12-15T08:39:49.729Z","0.4.0":"2021-11-18T08:55:35.314Z","0.5.0":"2023-05-09T15:33:06.826Z"},"author":{"name":"ShinyAds"},"license":"ISC","homepage":"https://github.com/20minutes/node-google-dfp","keywords":["Google","DFP","DoubleClick","adserver"],"repository":{"url":"https://github.com/20minutes/node-google-dfp.git","type":"git"},"description":"Google DFP API Helper Library for NodeJS","contributors":[{"name":"Andre de Souza","email":"ajsouz@gmail.com"},{"name":"Gregory Pike","email":"greg@gregpike.ca"}],"maintainers":[{"name":"j0k3r","email":"jeremy.benoist@gmail.com"},{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"}],"readme":"# Google DFP API Client for NodeJS\n[![Node CI](https://github.com/20minutes/node-google-dfp/actions/workflows/nodejs.yml/badge.svg)](https://github.com/20minutes/node-google-dfp/actions/workflows/nodejs.yml)\n\nThis is exactly the same plugin as [node-google-dfp](https://github.com/rubicon-project/node-google-dfp) but with dependencies up to date.\n\n```\nyarn add @20minutes/node-google-dfp\n```\n\n## Basics\n\nInitialize the DFP Instance.\n\n```JavaScript\nimport Dfp from 'node-google-dfp'\ndfpUser = 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  const statement = new DfpClass.Statement('WHERE id = 103207340')\n\n  lineItemService.getLineItemsByStatement(statement, function (err, results) {\n    console.log(results)\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\nimport { JWT } from 'google-auth-library'\n\nconst jwtClient = new JWT(\n  SERVICE_ACCOUNT_EMAIL,\n  'path/to/key.pem',\n  null,\n  ['https://www.googleapis.com/auth/dfp'],\n)\n\ndfpUser.setClient(jwtClient)\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* 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","readmeFilename":"README.md"}