Documentation
API Reference

Embed Integration

Add a full-featured image editor to your application. Let users create beautiful screenshots without leaving your app.

Quick Setup

Add in 5 minutes

Full API

PostMessage control

Secure

Sandboxed iframe

Themeable

Match your brand

Quick Start

1

Add the iframe to your page

index.html
<iframe
  src="https://zenshotz.com/embed?plugin=screenshot&partnerId=YOUR_ID"
  width="100%"
  height="600"
  frameborder="0"
  allow="clipboard-write"
></iframe>
2

Listen for events (optional)

app.js
window.addEventListener('message', (event) => {
  const { type, imageData } = event.data;
  
  if (type === 'ZENSHOTZ_READY') {
    console.log('Editor is ready!');
  }
  
  if (type === 'ZENSHOTZ_EXPORT_COMPLETE') {
    // Save the exported image
    downloadImage(imageData);
  }
});

URL Parameters

ParameterType
partnerIdrequiredstring
pluginstring
themelight | dark
hideExportboolean
hideSidebarboolean

PostMessage API

Send to Embed

ZENSHOTZ_LOAD_IMAGE

Load an image from URL

ZENSHOTZ_LOAD_IMAGE_BASE64

Load from base64

ZENSHOTZ_SET_BACKGROUND

Set background settings

ZENSHOTZ_EXPORT

Trigger export

ZENSHOTZ_GET_STATE

Get editor state

Receive from Embed

ZENSHOTZ_READY

Editor loaded

ZENSHOTZ_EXPORT_COMPLETE

Export finished

ZENSHOTZ_EXPORT_ERROR

Export failed

ZENSHOTZ_STATE

Current state

Complete Example

index.html
<!DOCTYPE html>
<html>
<head>
  <title>My App with Zenshotz</title>
</head>
<body>
  <div id="editor"></div>
  <button id="export-btn">Export Image</button>

  <script>
    // Create iframe
    const iframe = document.createElement('iframe');
    iframe.src = 'https://zenshotz.com/embed?plugin=screenshot&partnerId=YOUR_ID';
    iframe.style.cssText = 'width:100%;height:600px;border:none;';
    document.getElementById('editor').appendChild(iframe);

    // Listen for events
    window.addEventListener('message', (e) => {
      if (e.data.type === 'ZENSHOTZ_EXPORT_COMPLETE') {
        // Download the image
        const link = document.createElement('a');
        link.download = 'image.png';
        link.href = e.data.imageData;
        link.click();
      }
    });

    // Export button
    document.getElementById('export-btn').onclick = () => {
      iframe.contentWindow.postMessage({
        type: 'ZENSHOTZ_EXPORT',
        format: 'png',
        resolution: '2x'
      }, '*');
    };
  </script>
</body>
</html>

Ready to integrate?

Contact us to get your partner ID and start embedding Zenshotz in your app.