JS SDK Advanced Features
The BubblaV JavaScript SDK offers advanced capabilities for deeper integration with your application. These features allow for personalized user experiences, custom data handling, and fine-grained control over conversations.
User Authentication & Context
Pass user information to the chatbot to provide personalized support and maintain conversation context across sessions.
window.BubblaV.setUser({
id: 'user-123',
email: 'user@example.com',
name: 'John Doe',
// Custom properties
plan: 'premium',
customer_id: 'CUST-456'
});

Custom Data & Events
Track custom events and send additional data to BubblaV for analytics or to trigger specific chatbot behaviors.
// Track a custom event
window.BubblaV.trackEvent('product_viewed', {
product_id: 'PROD-789',
product_name: 'Wireless Headphones',
price: 99.99
});
// Listen for chatbot events
window.BubblaV.on('message_sent', (message) => {
console.log('User sent message:', message);
});
Conversation Management
Gain more control over the conversation flow, including starting new conversations, ending existing ones, and requesting human agent handover.
// Start a new conversation
window.BubblaV.startNewConversation();
// End the current conversation
window.BubblaV.endConversation();
// Request human agent handover
window.BubblaV.requestHumanAgent('Technical issue with product');
Explore More JS SDK Topics
Continue learning about the BubblaV JavaScript SDK.