2.2.2 • Published 5 years ago

@nutshelllab/sns-messenger v2.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago