{"id":18394,"library":"google-ads-node","title":"google-ads-node (low-level Google Ads gRPC client)","description":"A low-level Google Ads API client library for Node.js, generated from the experimental Bazel build files. This package is the compiled output of protobuf definitions and requires manual setup, no user-facing documentation is provided. The current version (23.0.0) corresponds to Google Ads API v23. The package is maintained by Opteo but is not recommended for direct use; instead, use the higher-level wrapper google-ads-api. Releases are tied to Google Ads API versions. Key differentiator: it provides raw gRPC stubs for advanced users who need custom control.","status":"active","version":"23.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/opteo/google-ads-node","tags":["javascript","google ads api","google ads","google ads nodejs","google ads js","ads node","grpc","proto","typescript"],"install":[{"cmd":"npm install google-ads-node","lang":"bash","label":"npm"},{"cmd":"yarn add google-ads-node","lang":"bash","label":"yarn"},{"cmd":"pnpm add google-ads-node","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Google API client runtime used for connection handling, auth, and gRPC setup.","package":"google-gax","optional":false}],"imports":[{"note":"The package provides named exports; default export is not available. The require pattern works but is not the recommended ES module style.","wrong":"const GoogleAdsClient = require('google-ads-node').GoogleAdsClient","symbol":"GoogleAdsClient","correct":"import { GoogleAdsClient } from 'google-ads-node'"},{"note":"The services object contains all gRPC service stubs like CampaignService, AdGroupService, etc. Both import and require work.","wrong":"const { services } = require('google-ads-node')","symbol":"services","correct":"import { services } from 'google-ads-node'"},{"note":"The types object provides protobuf message types used in requests/responses. This is a named export.","wrong":null,"symbol":"types","correct":"import { types } from 'google-ads-node'"},{"note":"Enums are exported as a nested object. Common mistake: trying to destructure enums incorrectly.","wrong":"const { enums } = require('google-ads-node').enums","symbol":"enums","correct":"import { enums } from 'google-ads-node'"}],"quickstart":{"code":"import { GoogleAdsClient, services, enums } from 'google-ads-node';\n\nasync function main() {\n  const client = new GoogleAdsClient({\n    developerToken: process.env.DEVELOPER_TOKEN ?? '',\n    clientId: process.env.CLIENT_ID ?? '',\n    clientSecret: process.env.CLIENT_SECRET ?? '',\n    refreshToken: process.env.REFRESH_TOKEN ?? '',\n  });\n\n  const customerId = '1234567890';\n  const campaignService = new services.GoogleAdsServiceClient(client);\n\n  const request = {\n    customerId: customerId,\n    query: `SELECT campaign.id, campaign.name FROM campaign WHERE campaign.status = 'PAUSED'`,\n  };\n\n  try {\n    const response = await campaignService.search(request);\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error(err.errors);\n  }\n}\n\nmain();","lang":"typescript","description":"Shows how to create a GoogleAdsClient, instantiate a service stub, and run a GAQL query using the GoogleAdsService."},"warnings":[{"fix":"Use the high-level library google-ads-api instead if you want a documented, easy-to-use client.","message":"This library is the raw compiled output of experimental build files; it has no user-friendly documentation and requires manual protobuf handling.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Refer to Google Ads API release notes and the package's changelog for migration steps between major versions.","message":"Major version updates correspond to Google Ads API major versions; breaking changes occur in service APIs, types, and enums.","severity":"breaking","affected_versions":">=23.0.0"},{"fix":"Check the Google Ads API deprecation schedule and update your code to use the recommended alternatives.","message":"Some service methods or types may be marked as deprecated in Google Ads API v23; use the latest version to avoid broken functionality.","severity":"deprecated","affected_versions":">=23.0.0"},{"fix":"Ensure your project uses Node ESM (type: module in package.json) or use require if sticking to CommonJS.","message":"The package is ESM via TypeScript compilation but the published npm package may include CommonJS files. Import resolution can be tricky.","severity":"gotcha","affected_versions":">=23.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install google-ads-node` and ensure the import uses the full package name.","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'google-ads-node'"},{"fix":"Change import to `import { GoogleAdsClient } from 'google-ads-node'`.","cause":"Default import used but the package only exports named exports.","error":"TypeError: GoogleAdsClient is not a constructor"},{"fix":"Verify that your developer token and OAuth2 credentials are correct and set in environment variables.","cause":"Missing or invalid developer token or OAuth credentials.","error":"Error: AuthenticationError.GOOGLE_ACOUNT_NOT_FOUND"},{"fix":"Add `customerId: '1234567890'` (without dashes) to the request.","cause":"The request object does not include `customerId` in the correct format (usually string of 10 digits).","error":"Error: Request is missing required field customer_id"},{"fix":"Use the version that matches the library version (e.g., v23 for google-ads-node@23.0.0).","cause":"Attempting to use an API version that is not supported by the library.","error":"Error: Invalid version: V23 is not a valid version"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}