Docs / Build / Embed an agent
View as MarkdownEmbed an agent
Put an agent in your web app with one script and one tag.
Add the Mindset script, create a session on your server, and place the <mindset-agent> element where the agent should appear.
1. Create a session on your server
ts
const session = await mindset.sessions.create({ agentId: 'support', userId: user.id })2. Add the element
html
<script src="https://cdn.mindset.ai/agent.js" async></script>
<mindset-agent session="SESSION_TOKEN"></mindset-agent>| Attribute | What it does |
|---|---|
session | The token from step 1 |
conversation-list | Lets users reopen earlier conversations |