# @google-cloud/channel 中文文档

规范地址：https://npmcn.com/package/%40google-cloud/channel/

版本：5\.2\.0
npm 元数据更新时间：2026-10-12T22:09:13.211Z
中文译文更新时间：2026-11-17T06:51:56.844Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40google-cloud/channel
原文对照：https://npmcn.com/package/%40google-cloud/channel/?lang=original
项目主页：https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel
源码仓库：https://github.com/googleapis/google-cloud-node

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：3.8 MB，31 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：1 个
- 首次发布：2021-01-13T23:16:21.953Z
- 最新版本发布：2026-10-12T22:09:13.033Z
- 近 30 天下载量：5446（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：46（近 12 个月 6 个）

## 中文简介

Node.js 的频道客户端

## 安装

```sh
npm install @google-cloud/channel
```

也可以使用：`pnpm add @google-cloud/channel`、`yarn add @google-cloud/channel`、`bun add @google-cloud/channel`

## README

![Google Cloud Platform logo](https://avatars2.githubusercontent.com/u/2810941?v=3&s=96 "Google Cloud Platform")

# [云频道 API: 节点客户端](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel)

这个图书馆被认为是 **稳定**。代码表面不会改变向后兼容的方式 除非绝对必要(例如,由于关键的安全问题)或 大量贬值期。 问题和要求 **稳定** 图书馆 以最高优先处理

[![npm version](https://img.shields.io/npm/v/@google-cloud/channel.svg)](https://www.npmjs.org/package/@google-cloud/channel)

Cloud 频道用于节点的 API 客户端

各版本的更改一览表载于 [变化](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/CHANGELOG.md)。 。 。 .

-   [Cloud Channel API Nodejs 客户端 API 参考](https://cloud.google.com/nodejs/docs/reference/channel/latest)

更多信息,请访问Cloud APIs的客户端库,包括老年人 Google APIs 客户端图书馆, in [客户端图书馆解释](https://cloud.google.com/apis/docs/client-libraries-explained)。 。 。 .

**目录 :**

-   [快速启动](https://npmcn.com/package/%40google-cloud/channel/#readme-quickstart)
    
    -   [在你开始之前](https://npmcn.com/package/%40google-cloud/channel/#readme-before-you-begin)
    -   [安装客户端库](https://npmcn.com/package/%40google-cloud/channel/#readme-installing-the-client-library)
-   [版本](https://npmcn.com/package/%40google-cloud/channel/#readme-versioning)
    
-   [捐款](https://npmcn.com/package/%40google-cloud/channel/#readme-contributing)
    
-   [许可证](https://npmcn.com/package/%40google-cloud/channel/#readme-license)
    

## 快速启动

### 在你开始之前

1.  [选择或创建云平台项目](https://console.cloud.google.com/project)。 。 。 .
2.  [启用您的工程计费](https://support.google.com/cloud/answer/6293499#enable-billing)。 。 。 .
3.  [启用云频道 API API](https://console.cloud.google.com/flows/enableapi?apiid=cloudchannel.googleapis.com)。 。 。 .
4.  [设置认证](https://cloud.google.com/docs/authentication/external/set-up-adc-local) 这样你就可以访问 当地工作站的API.

### 安装客户端库

```bash
npm install @google-cloud/channel
```

## 样本

样本在 [`samples/`](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples) 目录。 每个样本 `README.md` 有运行样本的指示.

| 样本 | 源代码 |
| --- | --- |
| 获取报告结果 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js) |
| 列表报告 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js) |
| 运行报告任务 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js) |
| 激活应享权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js) |
| 取消应享权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js) |
| 更改报价 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js) |
| 变化参数 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js) |
| 更改更新设置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js) |
| 检查云身份账户是否存在 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js) |
| 创建频道伙伴链接 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js) |
| 创建频道伙伴重编配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js) |
| 创建客户端 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js) |
| 创建客户端重置配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js) |
| 创建应享权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js) |
| 删除频道伙伴重刻配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js) |
| 删除客户端 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js) |
| 删除客户端重刻配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js) |
| 获取频道伙伴链接 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js) |
| 获得频道伙伴重刻配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js) |
| 找客户 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js) |
| 获得客户重置配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js) |
| 获得应享权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js) |
| 进口客户 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js) |
| 列表频道伙伴链接 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js) |
| 列表频道伙伴重刻配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js) |
| 列表客户重写配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js) |
| 列表客户 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js) |
| 列表权利变动 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlement_changes.js) |
| 清单应享待遇 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js) |
| 清单邀请 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js) |
| 列表产品 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js) |
| 列表可购买报价 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js) |
| 列表可购买的骷髅 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js) |
| 列表 sku 组可计费的 skus | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_group_billable_skus.js) |
| 列表 sku 组 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_groups.js) |
| 列表skus | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js) |
| 列表订阅者 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js) |
| 列出可转让报价 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js) |
| 列表可转移的骷髅 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js) |
| 查询报价 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js) |
| 提供云特性 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js) |
| 查询符合条件的账单账户 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js) |
| 注册订阅者 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js) |
| 开始有偿服务 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js) |
| 中止权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js) |
| 转移应享权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js) |
| 转到谷歌的权利 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js) |
| 未注册订阅者 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js) |
| 更新频道伙伴链接 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js) |
| 更新频道伙伴重编配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js) |
| 更新客户端 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js) |
| 更新客户端重置配置 | [源代码](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js) |

## 支持的节点.js版本

我们的客户端图书馆跟着 [节点.js发布时间表](https://github.com/nodejs/release#release-schedule)。 。 。 . 图书馆兼容所有当前 _活动_ 财务报告和审定财务报表 _维修_ 版本 节点.js. 如果你在使用"节点"(Node.js)的报废版本,我们建议你更新 尽快到积极支持的LTS版本.

Google 的客户端库支持在 a 上的 Node.js runtimes 的遗留版本 以下列警告为依据:

-   后遗症版本不进行连续整合测试.
-   一些安全补丁和特性不能被后移植.
-   依赖关系不能不断更新.

设有针对Node.js的一些报废版本的客户端图书馆,以及 可以通过 npm 安装 [秒数](https://docs.npmjs.com/cli/dist-tag)。 。 。 . 立面遵循命名惯例 `legacy-(version)`。 。 。 . 譬如说, `npm install @google-cloud/channel@legacy-8` 安装客户端库 用于兼容Node.js 8的版本.

## 版本

这个图书馆跟随 [语义版本](http://semver.org/)。 。 。 .

更多信息 : [谷歌云平台启动阶段](https://cloud.google.com/terms/launch-stages)

## 捐款

欢迎捐款! 见 [贡献指南](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md)。 。 。 .

请注意: `README.md` 和该寄存器中的各种配置文件(包括 `.nycrc` 财务报告和审定财务报表 `tsconfig.json`(中文(简体) ) 从中央模板生成.

## 许可证

Apache 版本 2.0

见 [自由主义](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)

## 常见问题

### @google-cloud/channel 是什么？

Node\.js 的频道客户端

### 如何安装 @google-cloud/channel？

在项目目录运行 npm install @google-cloud/channel，或使用 pnpm add / yarn add / bun add。

### @google-cloud/channel 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @google-cloud/channel 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @google-cloud/channel 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @google-cloud/channel 可以商用吗？

@google-cloud/channel 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @google-cloud/channel 的下载量有多少？

根据 npm 官方下载统计，@google-cloud/channel 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,446 次，日均约 182 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @google-cloud/channel 还在维护吗？

最新版本 5\.2\.0 发布于 2026/10/13（1 个月前）；至今共发布 46 个版本，其中过去 12 个月发布了 6 个；首次发布于 2021/01/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

