Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hesto2/notification-service
Router for various projects to be able to send notifications to me via slack and for slack to be able to send various messages/actions back to the projects.
https://github.com/hesto2/notification-service
Last synced: 9 days ago
JSON representation
Router for various projects to be able to send notifications to me via slack and for slack to be able to send various messages/actions back to the projects.
- Host: GitHub
- URL: https://github.com/hesto2/notification-service
- Owner: hesto2
- Created: 2020-05-24T01:14:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-24T20:15:33.000Z (about 4 years ago)
- Last Synced: 2024-11-06T00:42:38.648Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About this project
This project is something I use to abstract the logic of sending notifications
away from miscellaneous other projects. The currrent implementation is for
notifying via slack. It also is the hub for handling miscellaneous webhook
requests and forwarding those to the appropriate project.# Message format:
```
{
"channel": "slack-channel",
"message": "some text here",
"image": "https://image_url.png",
"actions": {
"senderId": "owlet-worker",
"actionId": "snooze",
"actions": [{"value": "1-hour", "displayValue": "1 Hour"}]
}
}
```# Configuration
## Slack App
Your slack appneeds the following scopes for the app: `files:write` `chat:write`
`channels:join` `channels:read` `groups:read` `im:read` `mpim:read`You also need to enable events for the app and post the url this is hosted at as
the target url.Once you have created the app, be sure to @mention the app in the channel you
want it to listen in on so it will receieve events for that.To enable interactions in your messages you will need to enable interactions and
then specify the url in the slack app configuration## Environment variables
`SLACK_API_TOKEN`: The endpoint that the slack integration should send messages
to`SLACK_SIGNING_SECRET`: The secret used to verify slack webhook requests
`SLACK_LISTEN_CHANNEL_ID`: the channel id that the webhook should listen to
`SLACK_BOT_NAME`: the name of the bot so we make sure that we don't let messages
this bot sends trigger the webhook causing an infinite loop of slack messages
being sent`RING_QUEUE_URL`: the queue url that slack webhook events should be sent to
## /v1/api...
### Slack
POST: `/api/slack`: channel, message, image (optional)
Webhooks: `/api/slack/events`: receives a payload anytime a subscribed channel
is usedInteractions: `/api/slack/interactions`: receives callback data from sent
actions to slack### Sentry
POST: `/api/sentry` for use with sentry internal webhook integration.