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

# Embed

Include 3rd party sites and widgets inside Flux sites.

<figure><img src="https://2635135911-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9NyC60xfSabdCmQW0heP%2Fuploads%2FqzSrrrBQYFwOZhtrtmeu%2Fimage.png?alt=media&amp;token=182d46a4-85ca-4609-911d-c6b6c3cd2e94" alt=""><figcaption><p>Embed Module in Editor</p></figcaption></figure>

Allows for the embedding of iframes into a Flux site. Useful for embedding other websites or widgets such as Youtube videos, Discord channels, or other 3rd party sites.

## Properties

## Target Origin

The target origin is a security feature to ensure Flux only sends messages to `<iframe>` content with known origins and only broadcasts `onReceivedPostMessage` for messages received from known origins.

**Example Discord Target Origin:**

```
https://discordapp.com
```

## Allow Script Tags

Checkbox to allow Embed Content to contain `<script>` tags that will be processed and injected into the page. This is disabled by default but may be enabled by content or template authors. Allowing script tags is explicitly opt-in because external scripts can be dangerous for security and can impact page load times in ways Flux can not control. Only ever use scripts from a trusted source.

## Embed Content

{% hint style="info" %}
Script tags are only allowed in the Embed Content property field if the "Allow Script Tags" property is checked.
{% endhint %}

The content to be embedded into the module. Typically an iframe HTML tag.

**Example Discord Embed:**

{% code overflow="wrap" %}

```html
<iframe class="discord" src="https://discordapp.com/widget?id=201798443583143936&theme=dark"/>
```

{% endcode %}

## Nodes

### Broadcasters

#### Embed:onReceivedPostMessage

Fires when a [Post Message](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) is received from the embedded site.

| Field   | Type   | Description                           |
| ------- | ------ | ------------------------------------- |
| Message | string | The body of the Post Message received |

### Listeners

#### Embed:SendPostMessage

When triggered, sends a [Post Message](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to the embedded site.

| Field   | Type   | Description                          |
| ------- | ------ | ------------------------------------ |
| Message | string | The body of the Post Message to send |
