# embedded-slack

> Embedded Slack is a built-in browser chat in JavaScript

Latest version **0.0.2** (published 2017-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install embedded-slack
pnpm add embedded-slack
yarn add embedded-slack
bun add embedded-slack
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-02-26 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Loïc JEAN-LAMBERT |
| Maintainers | pacdiv |
| Keywords | embedded, slack, client, react |

## Links

- npm: https://www.npmjs.com/package/embedded-slack
- Repository: https://github.com/pacdiv/embedded-slack
- Issues: https://github.com/pacdiv/embedded-slack/issues
- npm.io page: https://npm.io/package/embedded-slack

## Dependencies (3)

- [slack](https://npm.io/package/slack.md) ^8.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [babel-preset-stage-2](https://npm.io/package/babel-preset-stage-2.md) ^6.22.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2017-02-26
- 0.0.1 — 2017-02-23

## README

# embedded-slack

embedded-slack allows you to add a Slack built-in chat on your website. This chat can be connected to your support team.

> **Note:** :warning:
> embedded-slack has been developed as a technical try to determine if Slack can be used from a web page, to allow customers to discuss with a support team. It currently works with a test token so, **at this time, using this package in production is not recommanded**.

### Prerequisites

----------

First, you'll need to generate a [test token](https://api.slack.com/docs/oauth-test-tokens) for your Slack team. Then, you need'll to pick one channel ID from your Slack team. If you don't have any channel ID, feel free to copy/paste and run the following code to get one:

```javascript
// channels.js
const slack = require('slack')
const token = "your_test_token"

slack.channels.list({ token }, (err, data) => {
  if (err) {
    console.error(err)
    return
  }
  console.log(data)
})
```
```bash
$ npm install slack
$ node channels.js
```

### Installation and setting up with webpack 2.x

----------

First, install embedded-slack and loaders using npm:
```bash
$ npm install --save embedded-slack
$ npm install --save-dev node-sass style-loader css-loader sass-loader
```
Then, add the following loader (lines 3 to 6) to your webpack module loaders:
```javascript
module: {
  loaders: [
    {
      test: /\.scss$/,
      loaders: [ 'style-loader', 'css-loader', 'sass-loader' ]
    }
  ]
}
```

### Usage

----------

In this example, we create an EmbeddedSlack object with the three mandatory properties:
```javascript
// index.js
import EmbeddedSlack from 'embedded-slack'

const chat = new EmbeddedSlack({
  containerId: 'embedded-slack',
  channel: 'your_channel_id',
  token: 'your_token'
})
```
```html
<!-- index.html -->
<body>
  <div id="embedded-slack" />
</body>
```

By including those lines to your code, if prerequisites and installation are setted, a blue div will appear at the bottom right of your webpage. When you will write a message in this channel from your favorite Slack client, this message will appear in the chat you've just setted; feel free to respond ! :slightly_smiling_face:

### Built With

----------

[Slack](https://github.com/smallwins/slack) - Slack Web and RTM API client for Node and the Browser

### License

----------

[MIT](LICENSE.md)

---
_Source: https://npm.io/package/embedded-slack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
