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

Chat Widget Setup

Introduction

The MarketFit Chat API provides a complete interface for integrating real-time chat functionalities into your website. This system allows you to create contextual chat experiences, manage conversations, and automate user interactions.

Installation and Configuration

Initialization

To enable the chat, you need to initialize the system with the chat configuration object.

// Initialize the full system with chat enabled window.MarketFit.init({ siteId: 'your-site-id', apiEndpoint: 'https://api.your-domain.com', chat: { enabled: true, agentName: 'Support', welcomeMessage: 'Hello! How can I help you?', title: 'Chat with us', position: 'bottom-right', theme: { primaryColor: '#007bff', secondaryColor: '#e9ecef', textColor: '#212529' }, accentColor: '#2f66c9', allowAnonymousMessages: false } });

init()

Initializes the complete MarketFit system with all necessary configurations.

Syntax

window.MarketFit.init(config)

Parameters

  • config object (required): Complete system configuration

Configuration Parameters

Main Configuration

  • siteId string (required): Unique identifier for your site
  • apiEndpoint string (required): API endpoint URL
  • chatHidden boolean (optional): Start chat hidden. Default: false
  • chat object (optional): Specific chat configuration

Chat Configuration

  • enabled boolean: Enable/disable chat
  • agentName string: Default agent name
  • welcomeMessage string: Initial welcome message
  • title string: Chat widget title
  • position string: Widget position (‘bottom-right’ | ‘bottom-left’)
  • theme object: Color and appearance configuration
  • allowAnonymousMessages boolean: Allow anonymous messages

Examples

Basic initialization:

window.MarketFit.init({ siteId: 'your-site-id', apiEndpoint: 'https://api.your-domain.com', chat: { enabled: true, agentName: 'Support', welcomeMessage: 'Hello! How can I help you?', title: 'Chat with us' } });

Initialization with hidden chat:

window.MarketFit.init({ siteId: 'your-site-id', apiEndpoint: 'https://api.your-domain.com', chatHidden: true, // Chat will start hidden chat: { enabled: true, agentName: 'Support', welcomeMessage: 'Hello! How can I help you?', title: 'Chat with us' } });
Last updated on