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>

Script params - The script parameters can be changed by the developer.

Initiator Example

<script>
        const partnerUserId = 'some-partner-id-625';
        const clientInfo = {
            firstName: 'John', // Required
            lastName: 'doe', // Required
            email: 'john.doe@mail.com', // Required
            birthday: '01-01-2004', // Optional
            phone: '+1-212-999999', // Optional
            gender: 'male' // Optional
        };

        const wishiSDK = window.ClientChatPlugin({
            element: document.getElementById('wishi-root'),
            partnerUserId: partnerUserId,
            clientInfo: clientInfo
        });
    </script>

wishi-key the key you have been supplied by Wishi support team.

wishi-plugin-envfeel 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