# Put the agent *on your page.*

Slide 5 of 12 · Show me the code

One script tag and one element. The SDK asks your endpoint for a session and runs the loop in the browser.

```html
<script src="https://eu.mindset.ai/sdk/mindset-agent.js"></script>

<mindset-agent agent="billing-help"></mindset-agent>

<script>
  const agent = document.querySelector("mindset-agent");

  agent.configure({
    getSession: async () => {
      const r = await fetch("/api/session");
      if (!r.ok) throw new Error("No session");
      return r.json();
    },
  });

  agent.addEventListener("mindset:error", (e) =>
    console.error(e.detail.code, e.detail.message),
  );
</script>
```

## Speaker notes

The agent needs an active version and Embedded in your own product ticked. The Embed tab in the Studio shows the host, org slug, environment slug and handle to use. Layout and theming are covered on the docs site.
