# @alicloud/eventbridge 中文文档

规范地址：https://npmcn.com/package/%40alicloud/eventbridge/

版本：1\.3\.2
npm 元数据更新时间：2022-08-30T09:20:46.882Z
中文译文更新时间：2026-11-06T02:07:33.422Z
软件包许可：ISC

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

原始 npm 页面：https://www.npmjs.com/package/%40alicloud/eventbridge
原文对照：https://npmcn.com/package/%40alicloud/eventbridge/?lang=original

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

- 包体积（解压后）：349 kB，6 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：4 个
- 首次发布：2020-11-10T03:03:46.028Z
- 最新版本发布：2022-08-30T09:20:46.775Z
- 近 30 天下载量：6714（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：6（近 12 个月 0 个）

## 中文简介

页:1 [简体中文](https://npmcn.com/package/%40alicloud/eventbridge/README-CN.md) ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)

## 安装

```sh
npm install @alicloud/eventbridge
```

也可以使用：`pnpm add @alicloud/eventbridge`、`yarn add @alicloud/eventbridge`、`bun add @alicloud/eventbridge`

## README

页:1 [简体中文](https://npmcn.com/package/%40alicloud/eventbridge/README-CN.md) ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)

# 阿里巴巴云事件 Bridge SDK

## 所需资源

-   节点.js >= 8.x

## 安装

如果您使用 `npm` 用于管理您的依赖,您可以使用以下命令:

```sh
$ npm install @alicloud/eventbridge -S
```

## 快速示例

在你开始之前,你需要报名 一个阿里巴巴云账户 并收回你的 [全权证书](https://usercenter.console.aliyun.com/#/manage/ak)。 。 。 .

## 演示

```javascript
import Client, * as $eventbridge from "@alicloud/eventbridge"
import Util from "@alicloud/tea-util";


const config = new $eventbridge.Config();
config.endpoint = "your endpoint";
config.accessKeyId = "your access key id";
config.accessKeySecret = "your access key secret";
// init client
const client = new Client(config);
// init request
const event = new $eventbridge.CloudEvent();
event.datacontenttype =  "application/json";
event.data = Util.toBytes("test");
event.id = "id";
event.source = "source";
event.specversion = "1.0";
event.type = "type";
event.time = "2020-08-24T13:54:05.965Asia/Shanghai";
event.subject = "1.0";
event.extensions = {
    "aliyuneventbusname": "demo-bus"
};

// call api
const resp = client.putEvents([event]);
```

## 参数规格

```javascript
const config = {
  AccessKeyId: "AccessKeyId", // AccessKey Id
  AccessKeySecret: "AccessKeySecret", // AccessKey Secret
  Credential: credential.Credential, // // credential，If you have any questions, please refer to it https://github.com/aliyun/credentials-nodejs/
  SecurityToken: "SecurityToken", // Security Token
  Endpoint: "Endpoint", // endpoint
  Protocol: "Protocol", // http or https
  RegionId: "RegionId", // region
  ReadTimeout: "ReadTimeout", // read timeout
  ConnectTimeout: "ConnectTimeout", // connect tiemout
  HttpProxy: "HttpProxy", // http proxy
  HttpsProxy: "HttpsProxy", // https proxy
  NoProxy: "NoProxy", // agent whitelist
  MaxIdleConns: "MaxIdleConns", // maximum number of connections
};

const RuntimeOptions = {
  Autoretry: "Autoretry", // whether to enable retry
  IgnoreSSL: "IgnoreSSL", // whether SSL validation is ignored
  MaxAttempts: "MaxAttempts", // maximum number of retries， defaut: 3
  BackoffPolicy: "BackoffPolicy", // retry the sleep strategy, default: no
  BackoffPeriod: "BackoffPeriod", // retry the sleep time,default: 1
  ReadTimeout: "ReadTimeout", // read timeout
  ConnectTimeout: "ConnectTimeout", // connect timeout
  LocalAddr: "LocalAddr", // the local network adapter ip
  HttpProxy: "HttpProxy", // http proxy
  HttpsProxy: "HttpsProxy", // https proxy
  NoProxy: "NoProxy", // agent whitelist
  MaxIdleConns: "MaxIdleConns", // maximum number of connections
  Socks5Proxy: "Socks5Proxy", // socks5 proxy
  Socks5NetWork: "Socks5NetWork" // socks5 agency agreement
};
```

## 问题

[开 幕 问 题](https://github.com/aliyun/alibabacloud-eventbridge-sdk/issues/new),不符合准则的问题可立即结案.

## 参考资料

-   [最近发布](https://github.com/aliyun/alibabacloud-eventbridge-sdk)

## 许可证

[阿帕奇 - 2.0](http://www.apache.org/licenses/LICENSE-2.0)

版权 (c) 2009年至今,阿里巴巴云 版权所有.

## 常见问题

### @alicloud/eventbridge 是什么？

页:1 简体中文

### 如何安装 @alicloud/eventbridge？

在项目目录运行 npm install @alicloud/eventbridge，或使用 pnpm add / yarn add / bun add。

### @alicloud/eventbridge 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/alicloud\_\_eventbridge 是否存在。

### @alicloud/eventbridge 支持 ESM 还是 CommonJS？

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

### @alicloud/eventbridge 可以商用吗？

@alicloud/eventbridge 使用 ISC 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @alicloud/eventbridge 的下载量有多少？

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

### @alicloud/eventbridge 还在维护吗？

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

