Send data into Slack in real-time by Incoming Webhooks.
npm install --save slackhooks
const slack = require('slackhooks')
// id or full url
const me = 'T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
const backend = 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
slack('Hey today is birthday of Camila :tada:', me)
// or if is need response
slack('Hey today is birthday of Camila :tada:', me).then(res => {
console.log(res)
})
// Advanced message formatting (Attachments, Message buttons)
// https://api.slack.com/docs/messages/builder
slack({
text: 'Status: Deploy done :ok_hand: Your build exited with 0.',
username: 'docker',
icon_emoji: ':whale:',
link_names: 1,
channel: '#backend'
}, backend)
MIT © Jesús Lobos