@nutshelllab/sns-messenger

Just sugar syntax over AWS SNS.send()

Stats

StarsIssuesVersionUpdatedCreatedSize
@nutshelllab/sns-messenger
082.2.22 years ago3 years agoMinified + gzip package size for @nutshelllab/sns-messenger in KB

Readme

sns-messenger

Build Status npm bundle size Maintainability

Just sugar syntax over AWS SNS.send()

Install

yarn add @nutshelllab/sns-messenger

Usage

import send from '@nutshelllab/sns-messenger'

const arn = topic => {
  const region = process.env.AWS_REGION
  const account = process.env.AWS_ACCOUNT_ID
  const stage = process.env.SLS_STAGE
  return `arn:aws:sns:${region}:${account}:${topic}-${stage}`
}

(async () => {
  await send(arn('my-topic'), { foo: 'bar' }, { Subject: 'foobar' })
})

API

snsMessenger(topicArn, payload, options)

topicArn

Type: string

SNS topic's arn to send message

payload

Type: Object

Message payload

options

Type: Object

Extra AWS SNS parameters, see AWSJavaScriptSDK documentation

License

MIT © Nutshell

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.