Nitrogen Pumpkin Mulch

    @nutshelllab/sns-messenger
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.2 • Public • Published

    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

    Keywords

    Install

    npm i @nutshelllab/sns-messenger

    DownloadsWeekly Downloads

    2

    Version

    2.2.2

    License

    MIT

    Unpacked Size

    5.18 kB

    Total Files

    9

    Last publish

    Collaborators

    • 7hanith
    • bluer4v3n
    • vblitz