UNPKG

widget-chatbot

Version:

- [![React][react.js]][react-url] - [![Socket-io][socket-io-img]][socket-io-url] - [![Chart.js][chart.js-img]][chart.js-url]

86 lines (67 loc) 2.21 kB
### Built With - [![React][react.js]][react-url] - [![Socket-io][socket-io-img]][socket-io-url] - [![Chart.js][chart.js-img]][chart.js-url] ### Requirements - Node : >=21.7.3 - react : >=^17.0.2 - react-dom : >=^17.0.2 - @emoji-mart/react - @ant-design/plots - antd - axios - react-markdown - remark-gfm ## Getting Started ```sh npm i widget-chatbot ``` ## Usage ```sh import Widget from 'widget-chatbot'; import { createBrowserHistory } from 'history'; import 'widget-chatbot/dist/widget-chatbot.css'; const history = createBrowserHistory(); const App = ()=>{ const initPayload = { access_token: 'jwt token', refresh_token: 'refresh token', uagent: window.navigator.userAgent, uriBackend: 'uri backend', uriService: 'uri open ai service chatbot', companyid: 'coid', companycode:'companycode', lang:'EN', uriBackendEnt: 'uri backend go', uriBackendHRMGO: 'uri backend hrm go', config: cookies?.CHATBOT?.config, } const textSayHiAndGetStarted = 'Hi and get started'; return ( <Widget getStartedPayload={getInitPayload()} history={history} keyEncrypt={keyEncrypt} onPayslipFn={{ onCheckPYAccess, onSubmitPYPwd, }} socketPath={socketPath || ''} socketURL={socketUrl} subTitle={textSayHiAndGetStarted} title={textSunfishAssistantTitle} isSF /> ) } ``` ## [Click this for Publish Process](./publish_process/README.md) <!-- Read [This](./publish_process/README.md) --> <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> [react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB [react-url]: https://reactjs.org/ [socket-io-url]: https://socket.io/ [socket-io-img]: https://img.shields.io/badge/Socket-io?logo=socketdotio&label=Socket.io [chart.js-url]: https://www.chartjs.org/ [chart.js-img]: https://img.shields.io/badge/Chart-js?logo=chartdotjs&logoColor=%23FF6384&label=Chart.js&labelColor=white&color=%23FF6384