{"id":41890868,"url":"https://github.com/rubicon-project/node-google-dfp","last_synced_at":"2026-01-25T14:06:53.937Z","repository":{"id":15943739,"uuid":"18686048","full_name":"rubicon-project/node-google-dfp","owner":"rubicon-project","description":"A service for integrating with Google DFP over NodeJS","archived":false,"fork":false,"pushed_at":"2021-11-15T08:41:00.000Z","size":123,"stargazers_count":86,"open_issues_count":3,"forks_count":34,"subscribers_count":17,"default_branch":"master","last_synced_at":"2026-01-14T07:39:41.998Z","etag":null,"topics":["api","dfp","google","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubicon-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-11T19:26:38.000Z","updated_at":"2025-08-27T12:05:46.000Z","dependencies_parsed_at":"2022-09-06T12:00:47.161Z","dependency_job_id":null,"html_url":"https://github.com/rubicon-project/node-google-dfp","commit_stats":null,"previous_names":["shinyads/node-google-dfp"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/rubicon-project/node-google-dfp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubicon-project%2Fnode-google-dfp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubicon-project%2Fnode-google-dfp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubicon-project%2Fnode-google-dfp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubicon-project%2Fnode-google-dfp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubicon-project","download_url":"https://codeload.github.com/rubicon-project/node-google-dfp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubicon-project%2Fnode-google-dfp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dfp","google","javascript","nodejs"],"created_at":"2026-01-25T14:06:53.845Z","updated_at":"2026-01-25T14:06:53.916Z","avatar_url":"https://github.com/rubicon-project.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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}\u0026scope=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}\u0026client_secret={YOUR_OAUTH_CLIENT_SECRET}\u0026code={YOUR_VERIFICATION_CODE}\u0026grant_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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubicon-project%2Fnode-google-dfp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubicon-project%2Fnode-google-dfp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubicon-project%2Fnode-google-dfp/lists"}