googleapis / googleapis/google-cloud-node

credentials must be a ChannelCredentials object

Open
#7,723 0 comments 0 reactions 0 assignees View on GitHub
library: google-cloud-node-core priority: p2 type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

An error occurred while executing the 'customer.conversionActions.create' method. 'Channel credentials must be a ChannelCredentials object',
The configuration information of my 'googleClientConfiguration' can be executed successfully in the Python version of SDK. Did I write it? Is there any problem?

import { GoogleAdsApi, services, enums } from 'google-ads-api';

function getCustomer(googleClientConfig: any, customerId: string): Customer {
const {
client_id: clientId,
client_secret: clientSecret,
developer_token: developerToken,
refresh_token: refreshToken,
login_customer_id: loginCustomerId,
} = googleClientConfig;
const client = new GoogleAdsApi({
client_id: clientId,
client_secret: clientSecret,
developer_token: developerToken,
});
const customer = client.Customer({
customer_id: customerId,
refresh_token: refreshToken,
login_customer_id: loginCustomerId,
});
return customer;
}

const customerId = 'xxxxxxxx';
const googleClientConfig = {
client_id: 'xxxx',
client_secret: 'xxxxx',
developer_token: 'xxxx',
refresh_token: 'xxxx',
login_customer_id: 'xxxxx'
};

const customer = getCustomer(googleClientConfig, customerId);
res = await customer.conversionActions.create([{
name: ’xxxxxxx‘,
status: enums.ConversionActionStatus.ENABLED,
click_through_lookback_window_days: 90,
type: enums.ConversionActionType.UPLOAD_CLICKS,
category: enums.ConversionActionCategory.DEFAULT,
}]);

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.