SNS client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids)
npm install @dazn/lambda-powertools-sns-clientSNS client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids).
Main features:
* direct replacement for AWS.SNS client
* auto-injects correlation IDs into SNS message when you call publish
* allow correlation IDs to be overriden with publishWithCorrelationIds (useful when processing batch-based event sources such as SQS and Kinesis, where every record has its own set of correlation IDs)
Install from NPM: npm install @dazn/lambda-powertools-sns-client
It's exactly the same as the SNS client from the AWS SDK.
``js
const SNS = require('@dazn/lambda-powertools-sns-client')
const publishMessage = async () => {
const req = {
Message: JSON.stringify({ message: 'hello sns' }),
TopicArn: 'my-sns-topic'
}
await SNS.publish(req).promise()
}
``