New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-eventbridge

Package Overview
Dependencies
Maintainers
5
Versions
448
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-eventbridge

AWS SDK for JavaScript Eventbridge Client for Node.js, Browser and React Native

  • 3.670.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
increased by6.47%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-eventbridge?

@aws-sdk/client-eventbridge is a part of the AWS SDK for JavaScript, which allows developers to interact with Amazon EventBridge. EventBridge is a serverless event bus service that makes it easy to connect applications using data from your own applications, integrated Software-as-a-Service (SaaS) applications, and AWS services.

What are @aws-sdk/client-eventbridge's main functionalities?

Put Events

This feature allows you to send custom events to an EventBridge event bus. The code sample demonstrates how to create an event and send it to the default event bus.

const { EventBridgeClient, PutEventsCommand } = require("@aws-sdk/client-eventbridge");

const client = new EventBridgeClient({ region: "us-east-1" });

const params = {
  Entries: [
    {
      Source: "com.mycompany.myapp",
      DetailType: "myDetailType",
      Detail: JSON.stringify({ key1: "value1", key2: "value2" }),
      EventBusName: "default"
    }
  ]
};

const run = async () => {
  try {
    const data = await client.send(new PutEventsCommand(params));
    console.log("Success, event sent; requestID:", data);
  } catch (err) {
    console.error(err);
  }
};

run();

Create Event Bus

This feature allows you to create a custom event bus. The code sample demonstrates how to create a new event bus named 'myCustomEventBus'.

const { EventBridgeClient, CreateEventBusCommand } = require("@aws-sdk/client-eventbridge");

const client = new EventBridgeClient({ region: "us-east-1" });

const params = {
  Name: "myCustomEventBus"
};

const run = async () => {
  try {
    const data = await client.send(new CreateEventBusCommand(params));
    console.log("Success, event bus created; ARN:", data.EventBusArn);
  } catch (err) {
    console.error(err);
  }
};

run();

List Rules

This feature allows you to list all the rules associated with a specific event bus. The code sample demonstrates how to list rules for the default event bus.

const { EventBridgeClient, ListRulesCommand } = require("@aws-sdk/client-eventbridge");

const client = new EventBridgeClient({ region: "us-east-1" });

const params = {
  EventBusName: "default"
};

const run = async () => {
  try {
    const data = await client.send(new ListRulesCommand(params));
    console.log("Success, rules listed:", data.Rules);
  } catch (err) {
    console.error(err);
  }
};

run();

Other packages similar to @aws-sdk/client-eventbridge

FAQs

Package last updated on 11 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc