Constructor
Create a widget instance by passing aVIZOCHOKWidgetConfig object to the constructor:
apiKey and storeId are provided and throws an Error immediately if either is missing.
Config Options
Required
Optional — Identity & Locale
Optional — Appearance
Optional — Callbacks
ThemeConfig
Thetheme property accepts a ThemeConfig object:
Full Example
Public Methods
After creating the widget instance, use these methods to control it:MountOptions
Session Persistence
The widget automatically persists chat history and conversation state tosessionStorage under the key vz-session-{storeId}. This means:
- Refreshing the page restores the previous conversation
- The
conversationIdis preserved across page navigations - Cart state is restored on reconnect via the
session_restoredserver message - Calling
destroy()clears stored session data - Calling
newChat()clears stored session data and resets the conversation
Session data is stored per-tab using
sessionStorage, not localStorage. Opening a new tab starts a fresh session.