Napoleonic Political Magnificence
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@dazn/lambda-powertools-eventbridge-client

1.26.0 • Public • Published

lambda-powertools-eventbridge-client

EventBridge client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids).

Main features:

  • auto-injects correlation IDs into the EventBridge events when you call putEvents

  • direct replacement for AWS.EventBridge client

Getting Started

Install from NPM: npm install @dazn/lambda-powertools-eventbridge-client

API

It's exactly the same as the EventBridge client from the AWS SDK.

const EventBridge = require('@dazn/lambda-powertools-eventbridge-client')
 
const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello eventbridge' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }
 
  await EventBridge.putEvents(putEventsReq).promise()
}

Keywords

none

Install

npm i @dazn/lambda-powertools-eventbridge-client

DownloadsWeekly Downloads

219

Version

1.26.0

License

MIT

Unpacked Size

10.7 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar