Skip to Content
The Makinari API repo now includes an MCP Server — connect your AI models directly. View on GitHub →

Control Functions

toggleChat()

Opens or closes the chat widget based on its current state.

Syntax

window.MarketFit.toggleChat()

Example

// Button to open/close chat document.getElementById('chat-toggle').addEventListener('click', () => { window.MarketFit.toggleChat(); });

sendChatMessage()

Programmatically sends a message to the chat.

Syntax

window.MarketFit.sendChatMessage(content)

Parameters

  • content string (required): Content of the message to send

Example

// Send automatic message window.MarketFit.sendChatMessage("User needs urgent assistance");

setChatWelcomeMessage()

Changes the default welcome message of the chat.

Syntax

window.MarketFit.setChatWelcomeMessage(message)

Parameters

  • message string (required): New default welcome message

Example

// Change message based on season window.MarketFit.setChatWelcomeMessage( "Black Friday Special Offer! How can we help you?" );

hideWidget()

Hides the chat widget from the interface without removing it completely.

Syntax

window.MarketFit.hideWidget()

Example

// Hide widget temporarily window.MarketFit.hideWidget();

showWidget()

Shows the chat widget if it was previously hidden.

Syntax

window.MarketFit.showWidget()

Example

// Show widget again window.MarketFit.showWidget();

reset()

Completely resets the widget, clearing all conversations and configurations.

Syntax

window.MarketFit.reset()

Example

// Reset widget after logout function onUserLogout() { window.MarketFit.reset(); }
Last updated on