Wishi partner widget/SDK documentation
  • The Formal Stuff
    • Introduction
    • iOS SDK
      • Setup
        • View controller setup example
      • Public protocols
      • Public API's
      • Data structures/types
    • Web SDK
      • Setup
      • Initialization
      • Data structures
      • Public API's/interfaces
      • Events subscription
      • Telemetry
    • Pixel
      • Set up the base code
      • Set up events
      • Tracking parameters
    • Client-side authentication
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. The Formal Stuff
  2. Web SDK

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({
            rootElement: 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

PreviousSetupNextData structures

Last updated 4 months ago

Was this helpful?