This module sends real-time notifications to Slack for important admin events.
Example Notifications

Configuration
Add the following environment variables to your .env file:
# Enable/disable Slack notifications
SLACK_ENABLED=true
# Slack webhook URL (get this from Slack app settings)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
# Comma-separated list of events to notify (use "*" for all events)
SLACK_EVENTS=user.signup,workspace.member.invited,workspace.member.added,workspace.member.removed,payment.success,payment.failed
# Or enable all events:
# SLACK_EVENTS=*Available Events
user.signup- New user registration via OAuthworkspace.member.invited- Member invited to a workspaceworkspace.member.added- Member accepted invitation and joined workspaceworkspace.member.removed- Member removed from workspacepayment.success- Successful payment (subscription or credit topup)payment.failed- Failed payment attempt
How to Get a Slack Webhook URL
- Go to https://api.slack.com/apps
- Create a new app or select an existing one
- Navigate to "Incoming Webhooks"
- Activate Incoming Webhooks
- Click "Add New Webhook to Workspace"
- Select the channel where notifications should be sent
- Copy the webhook URL and add it to your
.envfile
Example Configuration
For production use (all events enabled):
SLACK_ENABLED=true
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx
SLACK_EVENTS=*For development (only critical events):
SLACK_ENABLED=true
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx
SLACK_EVENTS=user.signup,payment.success,payment.failedTo disable Slack notifications:
SLACK_ENABLED=falseArchitecture
The module consists of:
- SlackService: Handles HTTP requests to Slack webhook and message formatting
- SlackNotificationListener: Listens to internal application events using NestJS EventEmitter
- Event Emitters: Various services emit events that trigger Slack notifications