Management Functions
Conversation Management
// Verify if there are existing conversations
const hasConversations = window.MarketFit.chat.hasConversations();
// Get list of conversations
const conversations = window.MarketFit.chat.getConversations();
// Get current chat state
const chatState = window.MarketFit.chat.getState();
// Get chat configuration
const chatConfig = window.MarketFit.chat.getConfig();User Management
// Identify current user
await window.MarketFit.identify({
name: 'Example User',
email: 'user@example.com',
userId: 'unique_user_id'
});
// Get identified user information
const currentUser = window.MarketFit.getCurrentUser();
// Verify if there is an identified user
const hasUser = window.MarketFit.hasIdentifiedUser();
// Clear user identity (logout)
window.MarketFit.clearUserIdentity();State Control
// Minimize chat
window.MarketFit.chat.minimize();
// Maximize chat
window.MarketFit.chat.maximize();
// Verify if enabled
const isEnabled = window.MarketFit.chat.isEnabled();
// Completely remove the chat
window.MarketFit.chat.remove();Last updated on