> For the complete documentation index, see [llms.txt](https://docs.supademo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.supademo.com/share/embed/popup-embed.md).

# Popup Embed

***

### Installation

#### Step 1: Add the Supademo SDK

Add this script tag inside the `<head>` or `<body>` tags of your website:

```html
<script src="https://script.supademo.com/supademo.js"></script>
```

#### Step 2: Add a Trigger Button

Create a button that calls the `Supademo.open()` function when clicked:

```html
<button onclick="Supademo.open('YOUR_DEMO_ID')">
  Take a tour
</button>
```

That's it! When clicked, your Supademo will open in a popup overlay.

***

### Opening a Showcase

To open a Showcase instead of a Demo, pass the type option:

```html
<button onclick="Supademo.open('YOUR_SHOWCASE_ID', { type: 'showcase' })">
  Take a tour
</button>
```

***

### Finding Your Demo/Showcase ID

Your ID can be found in the URL when viewing your Demo or Showcase:

* **Demo**: `https://app.supademo.com/demo/[YOUR_DEMO_ID]`
* **Showcase**: `https://app.supademo.com/showcase/[YOUR_SHOWCASE_ID]`

***

### Single-Page Applications

For React, Vue, Angular, or Svelte applications, call `Supademo.open()` from your click handler after the SDK script has loaded.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.supademo.com/share/embed/popup-embed.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
