m4Mindset docs

Mindset v3 / Deploy in your app / Integrate Agent Chat SDK 3

View as Markdown

SDK 3.0 HTML Tags and Methods Reference

Complete reference for all attributes and parameters of SDK 3.0 tags and methods

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

fetchAuthenticationfunctionpath

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).

appUidstringpathrequired

The unique identifier for your Mindset AI application. This is provided by the Mindset AI team.

themeobjectpath

An object containing the color theme for the agent UI.

Theme Customization

See Agent UI Color Theme documentation

customFontThemeobjectpath

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

enableVoicebooleanpathdefault: false

Enable or disable voice interaction with the agent.

Voice Features

See Agent Voice documentation

Examples

Authenticated Access
mindset.init({
    fetchAuthentication: getAuthToken, 
    appUid: "YOUR-APP-UID",
    theme: selectedTheme,
    customFontTheme: customFontTheme,
    enableVoice: true
});
Anonymous Access
mindset.init({
    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

agentUidstringpathrequired

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

initialQuestionstringpath

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.

variablesstringpath

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

stylestringpath

Inline CSS styles to apply to the agent element.

Example

html
<mindset-agent 
    agentUid="AGENT-UID"
    initialQuestion='What is your purpose?'
    style="display: block;">
</mindset-agent>
javascript
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

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