Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dazn/lambda-powertools-firehose-client

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dazn/lambda-powertools-firehose-client

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

latest
npmnpm
Version
1.28.1
Version published
Weekly downloads
4
300%
Maintainers
6
Weekly downloads
 
Created
Source

lambda-powertools-firehose-client

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

Main features:

  • auto-injects correlation IDs into Firehose records when you call putRecord or putRecordBatch (only JSON payloads are supported currently)

  • direct replacement for AWS.Firehose client

Getting Started

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

API

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

const Firehose = require('@dazn/lambda-powertools-firehose-client')

const publishEvent = async () => {
  const putRecordReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    PartitionKey: uuid(),
    Data: JSON.stringify({ message: 'hello firehose' })
  }

  await Firehose.putRecord(putRecordReq).promise()
}

const publishEvents = async () => {
  const putRecordBatchReq = {
    DeliveryStreamName: 'lambda-powertools-demo',
    Records: [
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      },
      {
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await Firehose.putRecordBatch(putRecordBatchReq).promise()
}

FAQs

Package last updated on 10 Dec 2020

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