Package Exports
- react-live-chat-customerly
- react-live-chat-customerly/dist/index.js
- react-live-chat-customerly/dist/react-live-chat-customerly.esm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-live-chat-customerly) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Live Chat from Customerly
Add the most powerful Live Chat to your React app.
⚙️ Install
Using npm
Run npm install --save react-live-chat-customerly
Using yarn
Run yarn add react-live-chat-customerly
🚀 How to use
To integrate Customerly Livechat to your React app, you need to have an account with Customerly. Sign up here.
import {CustomerlyProvider} from "react-live-chat-customerly";
ReactDOM.render(
<CustomerlyProvider appId={"YOUR_APP_ID"}>
<App/>
</CustomerlyProvider>,
document.getElementById("root")
);And then, you can use the useCustomerly hook to load the messenger, and interact with it.
const App: FunctionComponent = () => {
const { load } = useCustomerly();
useEffect(() => {
load({ ... })
}, []);
return (
<Things />
)
}useCustomerly
This hook exposes all the available methods mentioned in the documentation, check it out.
load- The entry point of Customerly, it loads the messenger in the webpageupdate- Same as load, but to refresh the messenger (e.g. after a sign in you might want to authenticate the user)open- Open programmatically the messengerclose- Close programmatically the messengershow- Show programmatically the messengerhide- Hide programmatically the messengerevent- Track an event for the user in the current sessionattribute- Track a property for the user in the current sessionsendNewMessage- Send a new messageshowNewMessage- Open and prefill the messenger with the specified messageregisterCallback- Register a callback (see available callbacks) fired by the messenger during the lifecycle
🙋 Contributing
If you have improvements that you'd like to see, or encounter any bugs, feel free to create an issue. Alternatively, please open a PR, and make sure that the new code is properly tested and all the steps.
We follow the Conventional Commits specification.