Initialization
Adding HTML element for Wishi to mount on
// Adding div block to your html file
<div id="styling-session-container">
<div id="wishi-root"></div>
</div>
Initiator Example
<script>
const partnerUserId = 'some-partner-id-625';
const clientInfo = {
firstName: 'John', // Required
lastName: 'doe', // Required
email: '[email protected]', // Required
birthday: '01-01-2004', // Optional
phone: '+1-212-999999', // Optional
gender: 'male' // Optional
};
const wishiSDK = window.ClientChatPlugin({
rootElement: document.getElementById('wishi-root'),
partnerUserId: partnerUserId,
clientInfo: clientInfo
});
</script>
wishi-key
the key you have been supplied by Wishi support team.
wishi-plugin-env
feel free to use either staging
or production
Once the script is loaded, the plugin will be available in window.WishiChat
.
Register and listen to
item-clicked
events.Stop the client by calling
wishiSDK.unmount()
.unmount
closes the connection to Wishi and unmounts the plugin from the element provided on initialization
Last updated
Was this helpful?