π οΈClient SDK
Client-side SDK functions for controlling the Wonderchat widget
Prerequisites
Available Functions
wonderchat.changeChatbotId()
wonderchat.changeChatbotId(chatbotId);// Switch to a different chatbot
wonderchat.changeChatbotId("your-new-chatbot-id");
// Example: Switch chatbot based on user selection
function switchToSupportBot() {
wonderchat.changeChatbotId("support-bot-123");
}
function switchToSalesBot() {
wonderchat.changeChatbotId("sales-bot-456");
}wonderchat.toggleChat()
wonderchat.identify()
wonderchat.clearHistory()
wonderchat.prefillQuestion()
Best Practices
Last updated
Was this helpful?