Skip to main content

mindset.init() Method

The mindset.init() method initializes the Mindset AI SDK with your specific configuration.

Quick Start Guide

See the Agent Front-end documentation for implementation examples

Parameters

fetchAuthentication
function
A function that returns a Promise resolving to the authentication token for the user. This token authenticates the user with the Mindset AI server.Only provide this parameter if your agent uses authenticated access (default mode).
appUid
string
required
The unique identifier for your Mindset AI application. This is provided by the Mindset AI team.
theme
object
An object containing the color theme for the agent UI.

Theme Customization

See Agent UI Color Theme documentation
customFontTheme
object
An object containing the custom font theme for the agent UI. Specify custom fonts for the agent’s text elements.

Font Customization

See Agent Fonts Customization documentation
enableVoice
boolean
default:"false"
Enable or disable voice interaction with the agent.

Voice Features

See Agent Voice documentation

Examples

mindset.init({
    fetchAuthentication: getAuthToken, 
    appUid: "YOUR-APP-UID",
    theme: selectedTheme,
    customFontTheme: customFontTheme,
    enableVoice: true
});

<mindset-agent> Tag

The <mindset-agent> tag embeds a Mindset AI agent within your application.

Implementation Guide

See Agent Front-end documentation for setup details

Attributes

agentUid
string
required
The unique identifier for the agent you want to embed.You can also pass an agentSessionUid to load the agent with existing session context.

Session Management

See Agent and Knowledge Context Provisioning
initialQuestion
string
A question to pre-fill the chat input field when the agent loads. This question is also transmitted each time the user starts a new thread.
variables
string
A stringified JSON object containing key-value pairs of variables to pass to the agent. These variables customize agent behavior, particularly for external source URLs.Format: Must be a stringified JSON object
style
string
Inline CSS styles to apply to the agent element.

Example

<mindset-agent 
    agentUid="AGENT-UID"
    initialQuestion='What is your purpose?'
    style="display: block;">
</mindset-agent>
const mindsettag = document.getElementsByTagName('mindset-agent')[0];
mindsettag.setAttribute('variables', JSON.stringify({ 
    variablekey1: "variable1value" 
})); 

<mindset-container> Tag

The <mindset-container> tag enables flexible UI mode for Mindset AI agents. It acts as a wrapper for the <mindset-agent> tag, allowing you to customize the appearance and behavior of the embedded agent.

Flexible UI Guide

See Agent Flexible UI documentation for implementation details

Attributes

This tag has no specific attributes.

Example

<mindset-container>
    <mindset-agent 
        agentUid="AGENT-UID"
        style="display: block;">
    </mindset-agent>
</mindset-container>