# ybot_webchat

> A react component for webchat

Latest version **0.1.11** (published 2022-03-16) · 0 weekly downloads

## Install

```sh
npm install ybot_webchat
pnpm add ybot_webchat
yarn add ybot_webchat
bun add ybot_webchat
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2022-03-16 |
| First published | 2022-03-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 17.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | hanguyen40091 |
| Maintainers | hanguyen40091 |
| Keywords | react, components, ui |

## Links

- npm: https://www.npmjs.com/package/ybot_webchat
- npm.io page: https://npm.io/package/ybot_webchat

## Dependencies (10)

- [axios](https://npm.io/package/axios.md) ^0.26.0
- [react](https://npm.io/package/react.md) ^16.8.6
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [botframework-webchat](https://npm.io/package/botframework-webchat.md) ^4.14.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^12.1.3
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.2
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 0.1.11 (latest) — 2022-03-16
- 0.1.10 — 2022-03-16
- 0.1.9 — 2022-03-16
- 0.1.8 — 2022-03-15
- 0.1.7 — 2022-03-10
- 0.1.6 — 2022-03-08
- 0.1.5 — 2022-03-03
- 0.1.4 — 2022-03-02
- 0.1.3 — 2022-03-02
- 0.1.2 — 2022-03-02
- 0.1.1 — 2022-03-01
- 0.1.0 — 2022-03-01

## README

# YBot webchat

Send props direct_line_token, user_id, onReset

```javascript
const Content = () => {
  const [token, setToken] = useState("");
  useEffect(() => {
    onReset();
  }, []);

  const onReset = async () => {
    const res = await fetch(
      "https://webchat-mockbot.azurewebsites.net/directline/token",
      { method: "POST" }
    );
    const response = await res.json();
    console.log(response);
    setToken(response.token);
    // setUserId(response.userID);
  };
  if (!token) return null;
  return (
    <YBotWebChat
      direct_line_token={token}
      user_id={"dl_d4b65f4c985000e110d5d89420797990"}
      onReset={onReset}
      header_text={"Test bot"}
      button_text={"Help"}
       onOpen={() => {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve({
              deploy_to_test: {
                success: true,
                valid: true,
              }
            });
          }, 3000);
        });
      }}
    />
  );
};
ReactDOM.render(
  <React.StrictMode>
    <Content />
  </React.StrictMode>,
  document.getElementById("root")
```

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