@alicloud/eventbridge

中文文档
1.3.2发布于 2022/08/30ISCCommonJS近 30 天下载 6714

English | 简体中文

原始使用文档
文档目录8 节
  1. Requirements
  2. Installation
  3. Quick Examples
  4. Demo
  5. Parameter Specification
  6. Issues
  7. References
  8. License

English | 简体中文

Alibaba Cloud EventBridge SDK

Requirements

  • Node.js >= 8.x

Installation

If you use npm to manage your dependence, you can use the following command:

$ npm install @alicloud/eventbridge -S

Quick Examples

Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your Credentials.

Demo

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]);

Parameter Specification

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
};

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

References

License

Apache-2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

版本与发布记录

@alicloud/eventbridge 共发布 6 个版本,首次发布于 2020/11/10;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.3.2latest2022/08/304 年前
1.3.02022/08/024 年前
1.2.32021/02/045 年前
1.2.22020/12/185 年前
1.2.12020/12/165 年前
1.2.02020/11/105 年前

关于 @alicloud/eventbridge 的常见问题

@alicloud/eventbridge 是什么?

English | 简体中文

如何安装 @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 和提交记录判断。