rn-helpcrunch
v0.1.13
Published
React Native component for Helpcrunch widget
Downloads
28
Maintainers
Readme
rn-helpcrunch
React Native component for Helpcrunch chat widget
Installation
npm install rn-helpcrunch --save
Usage
import { HelpCrunchWidget } from 'rn-helpcrunch';
const widgetRef = useRef();
const user = {
email: '[email protected]',
name: 'reactNativeUser',
user_id: '32132133123123'
};
const loginUser = (user) => {
widgetRef.current.userAuth(user);
}
const onReady = () => {}
const onChatOpen = () => {}
const onChatClose = () => {}
const onCustomerMessage = () => {}
const onAgentMessage = () => {}
const onNewUnreadChat = () => {}
const onPreChatFormSubmit = () => {}
const onError = () => {}
// ...
useEffect(() => {
loginUser(user);
}, [dependencies]);
<HelpCrunchWidget organization="organization"
appId="appId"
ref={widgetRef}
onReady={onReady}
onChatOpen={onChatOpen}
onChatClose={onChatClose}
onCustomerMessage={onCustomerMessage}
onAgentMessage={onAgentMessage}
onNewUnreadChat={onNewUnreadChat}
onPreChatFormSubmit={onPreChatFormSubmit}
onError={onError}
></HelpCrunchWidget>
License
MIT
Made with create-react-native-library