react-slack-webhook
v0.0.5
Published
📢 Send a message directly to a Slack channel from a React app
Downloads
23
Maintainers
Readme
📦 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:',
})
}
...
🎈 Props
| Key | Default | Type | | --- | --- | --- | | text | "hello, world" | string | | channel | "#general" | string | | username | "bot" | string | | icon_emoji | ":robot_face:" | string |