providesupport-live-chat-window-react
v1.1.0
Published
Components for adding chat to a react application
Downloads
43
Maintainers
Readme
Provide Support Live Chat component for React.js
This component is designed to add Provide Support Live Chat widget to a web application.
To use it you need to have an account in Provide Support Live Chat system.
Demo
Demo with custom chat button position on different pages
Demo with additional styles applied to chat button
Demo with several chat links on one page
Installing / Getting started
This package is available in NPM repository as providesupport-live-chat-window-react. It works correctly with all popular bundlers.
npm install providesupport-live-chat-window-react --save
Include the Component
To start using live chat with React.js, import LiveChat component from the providesupport-live-chat-window-react package and pass your Provide Support account name or account hash as "company" parameter.
import React from 'react';
import { LiveChat } from 'providesupport-live-chat-window-react';
export default () => (
<div className="app">
<LiveChat company="account_name_or_hash" />
</div>
);
The LiveChat component should be as close to the root of the application as possible since it contains an iframe.
LiveChat Props
| Prop name | Description | Is required | Default value | | ---------------------------- | ----------------------------------------------------------------------- | ----------- | -------------------------- | | company | Account name specified during registration | ✓ | n/a | | isUploadAfterDocumentLoaded | Load chat button after page loads | ✖ | true | | (...otherParams) | All other parameters will be passed to the banner download URL | ✖ | n/a |