💡 Want the big picture first? See what an AI web chat widget can do for your website on the Web Chat Widget overview.
Welcome to the Web Chat Bots guide! This section provides detailed instructions on how to create and customize interactive chat bots for your website using the Mingleego platform. You will learn how to set up a bot from scratch, tailor its appearance to align with your brand, and prepare it for seamless user interaction. This guide is designed to walk you through each step of the process, ensuring you can create a bot that meets your website's needs. Begin with the Creating a New Web Chat Bot section to set up your bot and explore its customization options.
Note: This guide assumes you have already created an account on the Mingleego platform. If not, please sign up here before proceeding.

A form will appear, where the details you need to provide to set up your bot include:
Assistant: Select an AI assistant that will power your bot's responses. Click the dropdown menu labeled Select Assistant to view the list of available assistants, and choose one that aligns with your bot's purpose, such as answering customer support queries or providing product information.
This assistant will handle all interactions with users.
If no assistants are listed, click the Create Assistant button to set up a new one. For detailed instructions on creating an assistant, refer to the Creating an Assistant Guide.
Bot Name: Enter a unique name in the Bot Name field for a support-focused bot.
API Key: Input the API key required for your bot to communicate with the Mingleego platform in the API Key field. You can find or generate an API key in the API Keys page. If you create a new API key, ensure you save it securely, as it will not be displayed again after creation.
After filling in these details, click the Next button to save your initial settings and proceed to the Configure the Settings section for customizing your bot's appearance, starting with its icon.
Once you have saved your initial settings, you can customize your bot's appearance to match your website's design and user experience goals. The Mingleego platform offers a range of options to adjust the bot's icon, chat window, and interaction settings. The first step is to configure the bot's icon.
The chatbot icon customization module allows you to adjust the appearance of the icon that users will interact with to initiate a chat. You can customize the icon preview, icon background, and preview area settings. A preview of the icon is displayed on the right side of the module, updating in real-time as you make changes.
![]()
The following customization options are available:
Icon Selection: Choose an icon for your chatbot from a list of predefined SVG icons in the left column. Click an icon to select it, and the preview will update to show your choice.
Icon Size: Adjust the icon's size using a slider in the left column. The default size is set to a medium value, and you can increase or decrease it as needed. The preview will reflect your changes.
After successfully customizing your bot's icon, click the Next button to proceed to the Chat Appearance section, where you can further adjust the look and behavior of your chat window.
The chat appearance customization module allows you to adjust the look and behavior of your bot's chat window. You can configure the chat frame, chat input, messages, and scroll button settings to enhance user interaction.
The Chat Frame section provides a comprehensive set of options to customize the chat window’s appearance, ensuring it integrates seamlessly with your website’s design.

This setting allows you to determine the placement of both the chat window and its associated icon on your website’s screen.
Fine-tune the dimensions of the chat window to ensure it fits well within your website’s layout. Use the following controls to adjust the width and height:
The preview area updates in real-time to reflect your changes.
In addition to the previously described background color settings, the chat background customization includes the following:
Customize the typography of the chat window to align with your website’s branding using the following controls:
Define the border properties of the chat window to enhance its visual distinction on your website using the following controls:
Customize the header of the chat window to display relevant information and align with your branding using the following controls:

After completing the customization of the chat frame, you have successfully defined the overall appearance of your chat window, including its position, size, typography, border, and header. Click the Next button to proceed to the Chat Input section, where you can configure the appearance and behavior of the input field for user messages.
This section allows you to customize the appearance and behavior of the chat input field—the area where users type their messages in the chat window. Below is an example of the chat input field as it appears in the chat:
The Mingleego platform provides a range of options to tailor this field to align with your website’s design and user experience goals. You can adjust settings such as the placeholder text, border radius, background color, shadow effects, and send icon color.
The following fields are available for customization in this section:

The following customization options are available:
After configuring these settings, click the Next button to proceed to the Messages section, where you can customize the appearance of the chat messages.
This section enables you to customize the appearance and behavior of chat messages within the chat window. You can configure the background colors for user and bot messages, adjust the border radius, enable or disable streaming responses, and set a default message to display when the chat opens.

The following customization options are available:
Streaming Responses: Enable or disable the streaming effect for the chatbot’s responses using the checkbox labeled Streaming Responses. When enabled (default), the chatbot’s answers appear gradually, simulating the effect of typing in a real conversation, which can make interactions feel more natural and engaging. When disabled, the full answer is displayed instantly, which may be preferred for faster communication. Toggle this option based on your desired user experience, and the preview will reflect the behavior.

Show Default Message: Enable or disable the display of a default message when the chat opens using the checkbox labeled Show Default Message. When enabled (default), a predefined message is shown to greet users as soon as the chat window opens. If disabled, the chat window will open without an initial message.
Default Message: Set the default message that appears when the chat opens by entering your desired text in the field labeled Default Message. The default text is “Hello! How can I assist you today?”. Update this to a greeting that suits your bot’s purpose, such as “Welcome! How can I help you?” or “Hi there! Ask me anything.” This option is only active if Show Default Message is enabled.

Message Border Radius: Adjust the border radius of all chat messages using the slider labeled Message Border Radius. The default value is 15 pixels, providing a slightly rounded appearance. Modify this value to create sharper or more rounded corners, with changes reflected in the preview.

User Message Background: Customize the background color of messages sent by the user in the chat. In the User Message Background section, use the color picker to define how user messages will appear in the chat window. To select a color, click the small colored square to the right of the label to open the color selection window, choose a shade from the palette or enter a hex code, and reset to the default color using the small circular arrow next to the color picker.
Bot Message Background: Customize the background color of messages sent by the bot in the chat. In the Bot Message Background section, use the color picker to define how bot messages will appear in the chat window. Follow the same steps as above to select a color and reset to the default if needed.
After configuring these settings, click the Next button to proceed to the Scroll Button section, where you can customize the appearance of the scroll button for navigating the chat.
This section allows you to customize the appearance of the scroll button, which enables users to navigate to the latest messages in the chat window. The Mingleego platform provides options to adjust the button’s border radius, dimensions, blur effect, icon color, and background color, ensuring it complements your chat window’s design.

The following customization options are available:
After configuring these settings, click the Create button to apply your changes. This finalizes the entire bot creation process, including the initial setup, icon customization, and chat appearance configuration. You can now proceed to the Integration section to learn how to add your bot to your website.
When a user interacts with your Mingleego web chat bot on your website, the chat generates a unique identifier, called smartTrekUserId, to track their conversation history. This identifier is stored in the browser's localStorage and is used to associate chat messages with a specific user session. Understanding how smartTrekUserId works is essential if you want to link chat histories to specific users on your website, especially for scenarios involving user authentication (e.g., when a user logs in).
This section explains how smartTrekUserId is generated, stored, and managed, and provides guidance on how you can retrieve and use it to enhance user experience. You’ll learn:
smartTrekUserId.smartTrekUserId from localStorage.smartTrekUserId and how it can be removed.smartTrekUserId to your authenticated users for persistent chat history.Note: The smartTrekUserId is specific to the browser and device used by the end user. If a user clears their browser data or uses a different device, a new smartTrekUserId will be generated.
The Mingleego chat bot automatically manages the smartTrekUserId for each user interacting with the chat on your website. Here’s how it works:
Generation:
localStorage for an existing smartTrekUserId.smartTrekUserId is found, the chat generates a new unique identifier using the UUID v4 format, prefixed with user- (e.g., user-123e4567-e89b-12d3-a456-426614174000).smartTrekUserId is stored in localStorage under the key smartTrekUserId.Usage:
smartTrekUserId is included in every message sent to the Mingleego backend, allowing the platform to associate the conversation with the specific user session.smartTrekUserId remains in localStorage.Lifespan:
smartTrekUserId persists in localStorage until it is explicitly removed (e.g., by clearing browser data or programmatically deleting the key).Removal:
smartTrekUserId can be removed by:
localStorage or all browsing data.localStorage.removeItem("smartTrekUserId")).smartTrekUserId unless instructed.As the website owner, you can access the smartTrekUserId stored in localStorage to link it with your user data (e.g., after a user logs in). Below is an example of how to retrieve the smartTrekUserId using JavaScript:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
This code checks for the smartTrekUserId in localStorage and logs it to the console. If the user has not yet interacted with the chat, the key may not exist until the chat is opened.
To maintain a consistent chat history for authenticated users (e.g., after they log in), you can associate the smartTrekUserId with their account in your backend. This is particularly useful if you want to retrieve a user’s chat history across sessions or devices. Here’s how you can implement this:
Retrieve smartTrekUserId After Login:
smartTrekUserId from localStorage.smartTrekUserId to your backend along with the user’s account ID.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Preserve smartTrekUserId Across Sessions:
smartTrekUserId to the user’s account, store it in your backend database.smartTrekUserId from your backend and set it in localStorage before the chat initializes.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Handle Chat History:
smartTrekUserId to query the Mingleego API for the user’s chat history, if needed. Contact the Mingleego support team for API details on retrieving chat history.Below is a complete example of how to handle smartTrekUserId in a React application after a user logs in:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
This component runs after a user logs in, checks for an existing smartTrekUserId, links it to the user’s account, and fetches a previously stored smartTrekUserId from your backend if needed. -->
smartTrekUserId in client-side code unnecessarily. Only retrieve and send it to your backend when linking to an account.smartTrekUserId).smartTrekUserId.localStorage is disabled in the user’s browser, consider fallback mechanisms (e.g., prompting the user to enable it).To clear a user’s chat history or disassociate their smartTrekUserId, you can remove it from localStorage. Here’s an example:
1 2 3 4 5 6 7 8 9 10 11 12 13
Note: Removing smartTrekUserId will cause a new ID to be generated the next time the user interacts with the chat, starting a new chat history.