Skip to content

cmg8431/react-slack-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

react-slack-webhook

๐Ÿ“ข Send a message directly to a Slack channel from a React app

downloads npm version MIT license Coverage Status


๐Ÿ“ฆ 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

Key Default Type
text "hello, world" string
channel "#general" string
username "bot" string
icon_emoji ":robot_face:" string

๐Ÿ“ License

MIT. Made with โค๏ธ by cmg8431

About

๐Ÿ“ข Send a message directly to a Slack channel from a React app

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published