TypeScript types and gRPC bindings for Google Ads API v21, generated from protobufs
npm install google-ads-api-typesTypeScript types and gRPC bindings for Google Ads API v21, generated from official Google protobufs.
``bash`
npm install google-ads-api-types
`typescript`
import { Campaign } from 'google-ads-api-types/google/ads/googleads/v21/resources/campaign.js';
import { CampaignStatusEnum_CampaignStatus } from 'google-ads-api-types/google/ads/googleads/v21/enums/campaign_status.js';
The compiled output is not committed to the repository. To generate it:
`bashInstall dependencies (needs protoc installed on your system)
npm install
$3
-
protoc (Protocol Buffers compiler) must be installed
- On macOS: brew install protobuf
- On Ubuntu: apt-get install protobuf-compilerPublishing
`bash
npm run compile
npm publish
`The
prepublishOnly script ensures compilation runs before publishing.What's Generated
-
dist/google/ads/googleads/v21/common/ - Common types
- dist/google/ads/googleads/v21/enums/ - Enum definitions
- dist/google/ads/googleads/v21/errors/ - Error types
- dist/google/ads/googleads/v21/resources/ - Resource types (Campaign, AdGroup, etc.)
- dist/google/ads/googleads/v21/services/` - gRPC service definitions