API Reference

Plugin Methods

Methods available on the Mindlogic Plugin instance.

The Mindlogic Plugin provides a set of methods you can use to interact with it programmatically, controlling its state, sending messages, resetting sessions, and managing notifications.

pushWelcomeMessage(message: string): void

Displays a welcome message popover in the plugin with the provided message content.

  • message (string): The welcome message to display inside the plugin.

Example

jsx
window.MLCPlugin.pushWelcomeMessage("How can we help you?");
pushNotification(): void

Adds a notification marker (such as a badge or indicator) on the plugin's trigger button.

Example

jsx
window.MLCPlugin.pushNotification();
pushChatUtm(keyword: string): void

Pushes an AI-generated welcome message based on the provided keyword.

  • keyword (string): The keyword used to generate the AI-driven welcome message.

Example

jsx
window.MLCPlugin.pushChatUtm("building an ai app");
deleteSession(): void

Programmatically resets the user's session within the plugin.

Example

jsx
window.MLCPlugin.deleteSession();
getSessionId(): string

Retrieves the current session ID of the user.

Example

jsx
const sessionId = window.MLCPlugin.getSessionId();
console.log(sessionId);
setSessionId(sessionId: string): void

Sets the plugin's current session ID.

  • sessionId (string): A string representing the session ID.

Example

jsx
window.MLCPlugin.setSessionId('<session_id>');
setLocale(locale: string): void

Programmatically sets the plugin's locale and pushes a new introduction text message in the selected language.

  • locale (string): The locale to switch to. Supported values are ko (Korean), en (English), ja (Japanese), zh (Chinese), and es (Spanish).

Example

jsx
window.MLCPlugin.setLocale("en");  // Switches the plugin to English
window.MLCPlugin.setLocale("ko");  // Switches the plugin to Korean
open(): void

Opens the plugin. This can be triggered programmatically to show the plugin without user interaction.

Example

jsx
window.MLCPlugin.open();
hide(): void

Closes or hides the plugin. This can be triggered programmatically to hide the plugin from view.

Example

jsx
window.MLCPlugin.hide();

Mindlogic, Inc.

331, Bongeunsa-ro, Gangnam-gu, Seoul, Republic of Korea

contact@mindlogic.ai