llama-error-notification-generator
v1.0.7
Published
This is a simple utility that allows for sending error messages to an [AWS SNS topic](https://aws.amazon.com/sns/) so they can be forwarded on to an email address subscribed to the topic.
Downloads
10
Readme
🦙 llama-error-notification-generator 🦙
This is a simple utility that allows for sending error messages to an AWS SNS topic so they can be forwarded on to an email address subscribed to the topic.
usage
environment configuration
This library requires certain environment variables to be present for it to run successfully:
AWS_ACCOUNT_ID
(required)- The AWS account id which contains the SNS topic
AWS_REGION
(optional)- The AWS region the SNS topic is located in
- Defaults to
us-east-1
SNS_NOTIFICATION_TOPIC_NAME
(required)- The name of the topic you want to send messages to
You can send a message like so:
await notificationGenerator.sendErrorNotification({
// An error in your application that requires email notification
error: someError,
// An identifier of the source application of the error
source: 'application-identifier'
})