This page provides a guide for embedding a Mindset agent in a Multiple Page Application.If you want to embed a Mindset agent in a Single Page Application (e.g., React, Vue, Angular), we recommend reading the current page in order to understand the main concepts and then checking the Sample code for embedding an agent in a Single Page Application
In the case that your agent uses the anonymous access, you have to whitelist URLs in your Agent Management Studio. (For example you can whitelist http://localhost while your are testing your code locally)
In case your agent uses the authenticated access, you have to set the fetchAuthentication param in the Mindset.init() method. (See above The fetchAuthentication method for more details)
In order to get your configuration parameters, you either contact the Mindset AI team or you can directly go on your Agents Management Studio dashboard listing your live agents.
For each of those agents you will be able to display the full deployment instructions with your specific configuration parameters already displayed:
Sample live agent deployment instructions:
Sample live agent deployment instructions
You can also ask directly Mindset for the required parameters:
Parameter
Description
MINDSET-SDK-URL
This will be provided by the Mindset AI team.
YOUR-APP-UID
Your appUid is provided by mindset.
YOUR-AGENT-UID
The agent Uid you want the user chat with. You can find that Agent Uid in the setting of the agent in the Agent Management Portal.
In case your agent uses the authenticated access, you have to set the fetchAuthentication param in the Mindset.init() method and provide a method which will be in charge of fetching the authToken from your Back-end authentication scriptLet’s say your front-end method is named getAuthToken, you then have to set the fetchAuthentication param as follows:
There is a default Theme color palette for the agent UI, but you can customize it by passing a theme parameter to the mindset.init() method.Please read the Agent UI color theme documentation for more details about the available options.
There is a default Font for the agent UI, but you can customize it by passing a customFontTheme parameter to the mindset.init() method.Please read the Agent Fonts customization documentation for more details about the available options.
The <mindset-agent> tag can be wrapped in any <Div> element of your page.But if you prefer to have a more flexible UI for your agent and you need to let the agent Ui always visible anywhere but without being intrusive, there is the option to enable the Flexible agent UI mode.Please read the Flexible Agent UI documentation for more details.