# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
