> Embed your LiveDemo on your website, landing pages or help center with a responsive iframe snippet.

Canonical: https://livedemo.ai/docs/share/embed-on-website/

# Embed on website

1. [Publish the demo](https://livedemo.ai/docs/share/share-your-public-livedemo/) (**Share → Public access**).
2. Open **Share → Embed** and click **Copy code** next to **Website**.
3. Paste the code into your page's HTML (in Webflow, WordPress or Framer use an **Embed** / **Custom HTML** block).

The code is a responsive iframe. It keeps the demo's aspect ratio at any width:

```html
<div style="position: relative; padding-bottom: calc(56.25% + 41px); height: 0;">
  <iframe src="https://story-api.livedemo.ai/workspaces/WORKSPACE_ID/stories/DEMO_ID/preview?step=1&embed" frameBorder="0" loading="lazy"
          webkitallowfullscreen mozallowfullscreen allowFullScreen
          style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 6px;"></iframe>
</div>
```

## URL options

Add these to the iframe `src`:

| Parameter | Effect |
| --- | --- |
| `step=1` | Step to start on |
| `autoplay=true` | Play automatically. See [Autoplay](https://livedemo.ai/docs/edit-a-livedemo/autoplay/) |
| `autoplayDelay=3` | Seconds per step when autoplaying |
| `disableAudio=true` | Mute voiceover and background music |
| `link=LINK_ID` | Use the variable values of a [custom link](https://livedemo.ai/docs/share/share-your-public-livedemo/#custom-links-paid-plans) |

## Embed on popular platforms

Copy the **Website** code first, then:

| Platform | Where to paste it |
| --- | --- |
| **WordPress** | Add a **Custom HTML** block |
| **Webflow** | Drag in an **Embed** element (Code Embed) |
| **Framer** | Insert an **Embed** component and choose **HTML** |
| **Wix** | **Add → Embed Code → Embed HTML**, then choose **Code** |
| **Squarespace** | Add a **Code** block |
| **HubSpot pages and blog** | In a rich text module, **Insert → Embed**, or use a custom HTML module |
| **Notion** | Type `/embed` and paste the `src` URL from the code (the `https://story-api.livedemo.ai/...` part) |
| **Zendesk Guide** | Open the article's **Source code** view and paste the code. If the iframe is stripped, ask your admin to allow `story-api.livedemo.ai` in Guide's embed settings |
| **React / Next.js** | Paste the code into JSX. It already uses `frameBorder` and `allowFullScreen` |
| **Plain HTML** | Paste it where the demo should appear |

If a platform doesn't allow iframes (most email tools, some help centers), share the link or a [GIF/video export](https://livedemo.ai/docs/share/export-in-gif-or-video/) instead.

## Listen to demo events

The embedded demo sends a message to your page every time the viewer reaches a step:

```js
window.addEventListener('message', (event) => {
    if (event.origin !== 'https://story-api.livedemo.ai') return
    if (event.data && event.data.type === 'step_index_changed') {
        const { stepNumber } = event.data.state // starts at 1
        // e.g. send it to Google Analytics, or detect the last step
    }
})
```

You can also move the demo to a step from your page:

```js
document.querySelector('iframe').contentWindow.postMessage({ type: 'changeStep', stepNumber: 3 }, '*')
```

## Troubleshooting

- **Blank iframe**: check that **Public access** is on.
- **Blocked by your site's Content Security Policy**: allow `story-api.livedemo.ai` in `frame-src`.
- **Demo loads external content that is blocked**: allow the domain under **Design & Settings → Security → Additional Content Security Policy**. See [Content Security Policy](https://livedemo.ai/docs/edit-a-livedemo/content-security-policy/).

More fixes in [Troubleshooting](https://livedemo.ai/docs/resources/troubleshooting/).

---

Next: [Share on Medium](https://livedemo.ai/docs/share/share-on-medium/)
