Just sugar syntax over AWS SNS.send()
yarn add @nutshelllab/sns-messenger
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' })
})
Type: string
SNS topic's arn to send message
Type: Object
Message payload
Type: Object
Extra AWS SNS parameters, see AWSJavaScriptSDK documentation
MIT © Nutshell