@checkd/notifications
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

README

Below you can find requisites necessary to use this package.

What is this package for?

This is a wrapper that allows you to integrate with notifications service and receive slack alerts about lambda errors.

How do I get set up?

  • Notifications wrapper expect that two environment variables are set. SERVICE and NOTIFICATIONS_QUEUE_URL. You can set them directly in serverless.yml or you can pass config object to the method call (and have them set for you). Config object takes precedence over serverless.yml config.

  • Ensure that your application has permission that allows sending messages to specified queue.

iamRoleStatements:
  - Effect: Allow
    Action:
      - "sqs:SendMessage"
    Resource:
      - !Sub arn:aws:sqs:${AWS::Region}:${AWS::AccountId}:notification-sender-${opt:stage, self:provider.stage}-*

*Please note that SERVICE value has to match the service name specified in serverless.yml

  • Use addAlerts method and pass the module object that contains all handlers you would like receive alerts for.
module.exports.processExample = require('path-to-handler-func');
const { addAlerts } = require('@checkd/notifications');
addAlerts(module); // With env variables defined in serverless.yml
// Alternative with config object -> addAlerts(module, { notificationsQueueUrl: "...", service: "..." })

Changelog

All notable changes to this project will be documented in this file.

[2.0.0] - July 10, 2023

  • Upgrade AWS SDK from version 2 to version 3.

    Starting from this version (2.0.0), our package requires Node.js runtime version 18 or newer due to the usage of AWS SDK v3. If you are using an older version of Node.js, please upgrade your runtime environment to ensure compatibility. AWS SDK v3 is not available for Node.js runtimes below version 18.

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

Readme

Keywords

none

Package Sidebar

Install

npm i @checkd/notifications

Weekly Downloads

2,998

Version

2.1.0

License

ISC

Unpacked Size

8.18 kB

Total Files

9

Last publish

Collaborators

  • andy-reynolds
  • adie_checkd
  • elnur0000
  • mlomnicki
  • christianjohnson