🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@gasbuddy/configured-sns-client

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasbuddy/configured-sns-client

A configuration driven SNS client

latest
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

configured-sns-client

Node CI

A small wrapper around the AWS SNS sdk to allow configuration from confit. This module focuses on publishing and consuming messages. Topic configuration for SNS is done OUTSIDE of this module (assumedly will be terraform or similar).

Usage

To send a message, you must configure this module in your service

{
  "region": "us-east-1",
  "accountId": "1234",
  "module": "require:@gasbuddy/configured-sns-client"
}

Now, you can publish to a topic (Note: Your service's role must have permission to pubish to the SNS topic)

  configuredSnsClient.publish(req, 'topic', { some: 'message' });

  // OR (with message attributes)
  configuredSnsClient.publish(req, 'topic', { some: 'message' }, {
      MessageAttributes: {
        Event_Type: {
          DataType: 'String.Array',
          StringValue: JSON.stringify(['user.registered']),
        },
      },
  });

You can set assumedRole to assert that your service has that role at the time of hydration

  {
  "assumedRole": "abc-topic-publisher",
  "region": "us-east-1",
  ....
}

Keywords

sns

FAQs

Package last updated on 24 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts