This page provides a guide for embedding a Mindset AI agent in a Multiple Page Application.If you want to embed a Mindset AI agent in a Single Page Application (e.g., React, Vue, Angular), we recommend reading this page to understand the main concepts, then check out the Sample code for Single Page Applications.
Quick Start
There are 3 steps to embed a Mindset AI agent in your application:1
Add the SDK Script
Include the SDK script in your HTML:Replace
MINDSET-SERVER-URL with the URL provided by Mindset AI.2
Add the Agent HTML Tag
Place the Replace
<mindset-agent> tag where you want the chat interface to appear:YOUR-AGENT-UID with the Agent UID you want to embed.3
Initialize the SDK
Call the Replace
mindset.init() method with your configuration:YOUR-APP-UID with your application UID.Getting Your Configuration Parameters
You can get your configuration parameters in two ways:Option 1: Agent Management Studio Dashboard
Go to your Agent Management Studio dashboard and view your live agents. For each agent, you can display full deployment instructions with your specific configuration parameters already populated.Option 2: Contact Mindset AI
Ask the Mindset AI team directly for these parameters:The SDK server URL configured for you by the Mindset AI team
Your application UID provided by Mindset AI (often your company name)
The UID of the agent you want users to chat with. Find this in the agent settings in the Agent Management Portal.
Authentication Methods
- Anonymous Access
- Authenticated Access
For agents using anonymous access, you’ll need to whitelist the URLs where your agent will be embedded. Please contact your CS manager to help you do so.
Complete Example
Shadow DOM Support
If you’re rendering the agent inside a Shadow DOM (commonly used in web components for style encapsulation), you need to explicitly pass the agent element to themindset.init() method.
For Standard Agent Embedding
When using<mindset-agent> inside Shadow DOM:
For Dynamic Views (Container Mode)
When using<mindset-container> for dynamic agent switching inside Shadow DOM:
Note: Shadow DOM is typically used in web components to isolate styles and markup. If you’re not using web components or Shadow DOM, you don’t need these parameters.
Customization Options
Customize UI Colors
The agent UI includes a default theme color palette, but you can customize it by passing atheme parameter to mindset.init().
Agent UI Color Theme
Learn how to customize colors, gradients, and visual styling
Customize Fonts
The agent UI includes a default font, but you can customize it by passing acustomFontTheme parameter to mindset.init().
Agent Fonts Customization
Learn how to apply custom fonts to your agent interface
Flexible Agent UI
The<mindset-agent> tag can be wrapped in any <div> element on your page. For a more flexible UI that remains visible without being intrusive, enable Flexible Agent UI mode.
Flexible Agent UI
Learn how to create floating, expandable agent interfaces