google-ads-api 25.1.0 → 25.1.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,12 +68,12 @@ import { GoogleAdsApi } from "google-ads-api";
68
68
  const client = new GoogleAdsApi({
69
69
  client_id: "<CLIENT-ID>",
70
70
  client_secret: "<CLIENT-SECRET>",
71
- developer_token: "<DEVELOPER-TOKEN>",
72
71
  });
73
72
  ```
74
73
 
75
74
  Optional client settings:
76
75
 
76
+ - `developer_token`: no longer needed. Google sunset developer tokens on 9 September 2026; API access levels now belong to the Google Cloud project that owns your OAuth client, and the API ignores the token. When it is unset or empty, no `developer-token` header is sent. Existing configurations that pass a token keep working until Google starts rejecting the header in a future major API version.
77
77
  - `grpc_channel_options`: [gRPC channel options](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js#supported-channel-options) applied to every service client this instance creates, for example `{ "grpc.keepalive_time_ms": 30000, "grpc.keepalive_timeout_ms": 10000 }`. Cached service clients are keyed by client id, refresh token and these options, so instances with different options never share a client.
78
78
  - `max_reporting_rows`: throw once a report or query returns more rows than this.
79
79
  - `disable_parsing`: return raw API responses instead of parsed rows.
@@ -107,7 +107,6 @@ This is a special client method for listing the accessible customers for a given
107
107
  const client = new GoogleAdsApi({
108
108
  client_id: "<CLIENT-ID>",
109
109
  client_secret: "<CLIENT-SECRET>",
110
- developer_token: "<DEVELOPER-TOKEN>",
111
110
  });
112
111
 
113
112
  const refreshToken = "<REFRESH-TOKEN>";
@@ -6,7 +6,13 @@ import { services } from "./protos/index.js";
6
6
  export interface ClientOptions {
7
7
  client_id: string;
8
8
  client_secret: string;
9
- developer_token: string;
9
+ /**
10
+ * Optional since the Google Ads API moved access levels from developer
11
+ * tokens to Google Cloud projects (September 2026). When unset or empty,
12
+ * no `developer-token` header is sent. The API ignores the value when it is
13
+ * present and will reject the header in a future major version.
14
+ */
15
+ developer_token?: string;
10
16
  disable_parsing?: boolean;
11
17
  max_reporting_rows?: number;
12
18
  grpc_channel_options?: grpc.ChannelOptions;
@@ -5,7 +5,7 @@ import { Hooks } from "./hooks.js";
5
5
  import TTLCache from "@isaacs/ttlcache";
6
6
  export declare const FAILURE_KEY = "google.ads.googleads.v25.errors.googleadsfailure-bin";
7
7
  export interface CallHeaders {
8
- "developer-token": string;
8
+ "developer-token"?: string;
9
9
  "login-customer-id"?: string;
10
10
  "linked-customer-id"?: string;
11
11
  }
@@ -84,9 +84,12 @@ class Service {
84
84
  };
85
85
  }
86
86
  get callHeaders() {
87
- const headers = {
88
- "developer-token": this.clientOptions.developer_token,
89
- };
87
+ const headers = {};
88
+ // Omitted rather than sent empty: the API rejects an empty developer-token
89
+ // header (DEVELOPER_TOKEN_PARAMETER_MISSING) but accepts a missing one.
90
+ if (this.clientOptions.developer_token) {
91
+ headers["developer-token"] = this.clientOptions.developer_token;
92
+ }
90
93
  if (this.customerOptions.login_customer_id) {
91
94
  headers["login-customer-id"] = this.customerOptions.login_customer_id;
92
95
  }
@@ -6,7 +6,13 @@ import { services } from "./protos/index.js";
6
6
  export interface ClientOptions {
7
7
  client_id: string;
8
8
  client_secret: string;
9
- developer_token: string;
9
+ /**
10
+ * Optional since the Google Ads API moved access levels from developer
11
+ * tokens to Google Cloud projects (September 2026). When unset or empty,
12
+ * no `developer-token` header is sent. The API ignores the value when it is
13
+ * present and will reject the header in a future major version.
14
+ */
15
+ developer_token?: string;
10
16
  disable_parsing?: boolean;
11
17
  max_reporting_rows?: number;
12
18
  grpc_channel_options?: grpc.ChannelOptions;
@@ -5,7 +5,7 @@ import { Hooks } from "./hooks.js";
5
5
  import TTLCache from "@isaacs/ttlcache";
6
6
  export declare const FAILURE_KEY = "google.ads.googleads.v25.errors.googleadsfailure-bin";
7
7
  export interface CallHeaders {
8
- "developer-token": string;
8
+ "developer-token"?: string;
9
9
  "login-customer-id"?: string;
10
10
  "linked-customer-id"?: string;
11
11
  }
@@ -44,9 +44,12 @@ export class Service {
44
44
  };
45
45
  }
46
46
  get callHeaders() {
47
- const headers = {
48
- "developer-token": this.clientOptions.developer_token,
49
- };
47
+ const headers = {};
48
+ // Omitted rather than sent empty: the API rejects an empty developer-token
49
+ // header (DEVELOPER_TOKEN_PARAMETER_MISSING) but accepts a missing one.
50
+ if (this.clientOptions.developer_token) {
51
+ headers["developer-token"] = this.clientOptions.developer_token;
52
+ }
50
53
  if (this.customerOptions.login_customer_id) {
51
54
  headers["login-customer-id"] = this.customerOptions.login_customer_id;
52
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-ads-api",
3
- "version": "25.1.0",
3
+ "version": "25.1.1-beta.0",
4
4
  "description": "Google Ads API Client Library for Node.js",
5
5
  "repository": {
6
6
  "type": "git",