Neolithic Programming Machine

    @dazn/lambda-powertools-kinesis-client
    TypeScript icon, indicating that this package has built-in type declarations

    1.28.1 • Public • Published

    lambda-powertools-kinesis-client

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

    Main features:

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

    • direct replacement for AWS.Kinesis client

    Getting Started

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

    API

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

    const Kinesis = require('@dazn/lambda-powertools-kinesis-client')
    
    const publishEvent = async () => {
      const putRecordReq = {
        StreamName: 'lambda-powertools-demo',
        PartitionKey: uuid(),
        Data: JSON.stringify({ message: 'hello kinesis' })
      }
    
      await Kinesis.putRecord(putRecordReq).promise()
    }
    
    const publishEvents = async () => {
      const putRecordsReq = {
        StreamName: 'lambda-powertools-demo',
        Records: [
          {
            PartitionKey: uuid(),
            Data: JSON.stringify({ message: 'hello kinesis' })
          },
          {
            PartitionKey: uuid(),
            Data: JSON.stringify({ message: 'hello lambda-powertools' })
          }
        ]
      }
    
      await Kinesis.putRecords(putRecordsReq).promise()
    }

    Keywords

    none

    Install

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

    DownloadsWeekly Downloads

    162

    Version

    1.28.1

    License

    MIT

    Unpacked Size

    18.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • ntog
    • davidrv87
    • gabriela_nowicka
    • criveindazn
    • mrwolny
    • dazn.builder.frontend
    • automation-drone
    • m.bazalik
    • dazn.oss.lambda.powertools
    • dazn.oss