fire-slack
fire-slack is a library that makes it easy and convenient to send Slack's Incoming Webhook from Cloud Functions.
Feature
- Automatically add
project_id
. - Add a link url to firebase's database. (optional)
- Add a error message and change it to red color. (optional)
Like this gif, firebase's database can be opened.
Installation
npm install --save fire-slack
Usage
1. Initialize
Initialize fire-slack in your index.ts.
Slack.initialize admin.AppOptionsfunctions.config.firebase, 'https://your-incoming-webhook-url', // optional
2. Send to slack
For example, when an error occurs on Cloud Functions.
webhook
options are the same as options in Incoming webhook. See Incoming Webhooks | Slack or typed-slack.d.ts.
.document`sampleorder/{orderID}`.onCreate
result: