react-slack-webhook
๐ข Send a message directly to a Slack channel from a React app
๐ฆ Installation
$ npm install react-slack-webhook $ yarn add react-slack-webhook $ pnpm add react-slack-webhook
๐ Usage
import { Slack } from 'react-slack-webhook'; import { SLACK_WEBHOOK_URL } from '@/constants' ... const onClick = () => { const slack = new Slack(SLACK_WEBHOOK_URL) return slack.send({ text: 'hello, world', channel: '#channel', username: 'bot', icon_emoji: ':robot_face:', }) } ...
More Example
๐ Props
KeyDefaultTypetextโhello, worldโstringchannelโ#generalโstringusernameโbotโstringicon_emojiโ:robot_face:โstring
๐ License
MIT. Made with โค๏ธ by cmg8431