# SDK

You don't need to implement our API to add a great editor feature to your application.

For a quick solution, try using our editor iFrame.

You can easily embed it with just a few lines of JavaScript code.\
\
You can choose between our classic editor, or AI powered MockAnything editor.

<figure><img src="https://1410134351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXeuL34FauPTZ6yb0wAep%2Fuploads%2FOvfhvHn86IBP0ttEPcki%2FCleanShot%202025-12-10%20at%2017.07.46%402x.png?alt=media&#x26;token=0492f1d0-39e1-4cb8-9b11-5536b9bdff72" alt=""><figcaption><p>Classic Embed Editor</p></figcaption></figure>

<figure><img src="https://1410134351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXeuL34FauPTZ6yb0wAep%2Fuploads%2FwDoaDssJOZcjXRSd3D0C%2FCleanShot%202025-12-10%20at%2017.09.33%402x.png?alt=media&#x26;token=82f52d5d-14b7-42ea-a14f-9806f12d4dc9" alt=""><figcaption><p>MockAnything Embed Editor</p></figcaption></figure>

## How to embed?

### CDN use:

Embed the iFrame in your app at the location where you want to display the editor:

```html
<iframe
      id="dm-iframe"
      src="https://embed.dynamicmockups.com"
      style="width: 100%; height: 90vh"
></iframe>
```

To power the embedded editor, you'll need to include the necessary JavaScript code from the following CDN:

```javascript
// you must add this script before using initDynamicMockupsIframe function in next step
<script 
    src="https://cdn.jsdelivr.net/npm/@dynamic-mockups/mockup-editor-sdk@latest/dist/index.js"
></script>
```

Lastly, use the initDynamicMockupsIframe function from the SDK with the following script:

```javascript
<script>
      document.addEventListener("DOMContentLoaded", function () {
        DynamicMockups.initDynamicMockupsIframe({
          iframeId: "dm-iframe",
          data: { "x-website-key": "Generate for free via our APP" },
          mode: "download",
        });
      });
</script>
```

### JavaScript framework:

Embed the iFrame in your app at the location where you want to display the editor.:

```html
<iframe
      id="dm-iframe"
      src="https://embed.dynamicmockups.com"
      style="width: 100%; height: 90vh"
></iframe>
```

Install package via npm registry:

<pre class="language-sh"><code class="lang-sh"><strong>npm install @dynamic-mockups/mockup-editor-sdk@latest
</strong>or
yarn add @dynamic-mockups/mockup-editor-sdk@latest
</code></pre>

Include package in your project and init iFrame:

```javascript
import { initDynamicMockupsIframe } from "@dynamic-mockups/mockup-editor-sdk";

initDynamicMockupsIframe({
     iframeId: "dm-iframe",
     data: { "x-website-key": "Generate for free via our APP" },
     mode: "download",
});
```

You'll notice the `x-website-key` field, [you can generate it for free via our APP](https://app.dynamicmockups.com/mockup-editor-embed-integrations).

Our Mockup Editor SDK lets you configure the iFrame and control its behavior within your application by providing data to the initDynamicMockupsIframe function. For complete configuration details, visit the [Editor Configuration](https://docs.dynamicmockups.com/mockup-editor-sdk/classic-editor-configuration) page.&#x20;

<figure><img src="https://1410134351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXeuL34FauPTZ6yb0wAep%2Fuploads%2FCrxwV7crbrgpoeIwgkDw%2Fimage.png?alt=media&#x26;token=17caa0cd-98ec-4c89-a4ef-c5e4d1ee689d" alt=""><figcaption><p>Embed Editor</p></figcaption></figure>

### Open a specific mockup in the Mockup Editor

By default, when you embed the mockup editor, the whole catalog will show up. \
You can also open a specific mockup directly.

<figure><img src="https://1410134351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXeuL34FauPTZ6yb0wAep%2Fuploads%2F3n45q0sB0yKFunszp1S4%2Fembed_mockup_editor.png?alt=media&#x26;token=ec0aa75b-f452-4499-9775-c2c53a4adc2d" alt=""><figcaption><p>Open a specific mockup in the Mockup Editor</p></figcaption></figure>

To achieve that, modify the `src` attribute to open a specific mockup by providing the `mockup uuid`.

```html
<iframe
      id="dm-iframe"
      src="https://embed.dynamicmockups.com/mockup/43981bf4-3f1a-46cd-985e-3d9bb40cef36/"
      style="width: 100%; height: 90vh"
></iframe>
```

You can access the `mockup uuid` from the [Get Mockups API](https://docs.dynamicmockups.com/api-reference/get-mockups-api) or in the URL of our web application editor.
