https://github.com/cmg8431/react-slack-webhook
📢 Send a message directly to a Slack channel from a React app
https://github.com/cmg8431/react-slack-webhook
alerts error-reporting notifications reactjs slack webhooks
Last synced: 4 months ago
JSON representation
📢 Send a message directly to a Slack channel from a React app
- Host: GitHub
- URL: https://github.com/cmg8431/react-slack-webhook
- Owner: cmg8431
- License: mit
- Created: 2024-01-02T02:09:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T08:50:48.000Z (over 1 year ago)
- Last Synced: 2025-05-23T07:53:22.631Z (5 months ago)
- Topics: alerts, error-reporting, notifications, reactjs, slack, webhooks
- Language: TypeScript
- Homepage:
- Size: 171 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
react-slack-webhook
📢 Send a message directly to a Slack channel from a React app
## 📦 Installation
```bash
$ npm install react-slack-webhook
$ yarn add react-slack-webhook
$ pnpm add react-slack-webhook
```
## 🚀 Usage
```ts
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]('https://github.com/cmg8431/react-slack-webhook/tree/main/example')
## 🎈 Props
| Key | Default | Type |
| --- | --- | --- |
| text | "hello, world" | string |
| channel | "#general" | string |
| username | "bot" | string |
| icon_emoji | ":robot_face:" | string |
## 📝 License
[MIT](./LICENSE). Made with ❤️ by [cmg8431](https://github.com/cmg8431)