The VowChat website SDK allows you to send additional user information and customize the live chat widget programmatically.
SDK Setup
Before using SDK methods, ensure the SDK is loaded by listening for the ready event:
window.addEventListener('vowchat:ready', function () {
// SDK is ready, you can use all SDK methods here
});
Widget Configuration
Customize the widget appearance and behavior using vowchatSettings:
window.vowchatSettings = {
hideMessageBubble: false,
position: 'right', // 'left' or 'right'
locale: 'en', // Language code
type: 'standard', // 'standard' or 'expanded_bubble'
};
Widget Types
Standard Widget:

Expanded Bubble Widget:

Setting User Information
Use the setUser method to identify users and pass custom attributes:
window.$vowchat.setUser("USER_IDENTIFIER", {
email: "user@example.com",
name: "John Doe",
avatar_url: "https://example.com/avatar.jpg",
phone_number: "+1234567890"
});
Identity Validation
For secure user identification, use HMAC-based validation:
window.$vowchat.setUser("USER_IDENTIFIER", {
email: "user@example.com",
name: "John Doe",
identifier_hash: "HMAC_HASH" // Generated on your server
});
Custom Attributes
Send custom data to segment and personalize conversations:
window.$vowchat.setCustomAttributes({
accountId: "12345",
pricingPlan: "pro",
signupDate: "2024-01-15",
isActive: true
});
Widget Visibility Control
Show or hide the message bubble programmatically:
// Hide the bubble
window.$vowchat.toggleBubbleVisibility('hide');
// Show the bubble
window.$vowchat.toggleBubbleVisibility('show');
Setting Labels
Add labels to conversations for better organization:
window.$vowchat.setLabel('premium-support');
Reset Session
Clear user data when a user logs out:
window.$vowchat.reset();
Additional SDK Methods
Set Language
window.$vowchat.setLocale('es'); // Spanish
Toggle Widget
window.$vowchat.toggle('open'); // or 'close'
Best Practices
-
Always wait for SDK ready: Use the
vowchat:readyevent before calling SDK methods -
Validate user identity: Use HMAC hashes for secure user identification
-
Clear sessions on logout: Call
reset()when users log out -
Use custom attributes: Pass relevant business context for better support
-
Set user email: Enable email continuity for better customer experience