Skip to main content
Bethemesh

Developer documentation

Embed Bethemesh Widgets

Complete guide to embed a Bethemesh tool in HTML, WordPress, Webflow, Wix or any CMS that accepts an iframe.

Back to widgetsRuntime v1

Quick start

Add a container, set the tool slug, then load the versioned runtime once.

Recommended integration
<div
  class="bethemesh-widget"
  data-tool="password-generator"
  data-lang="en"
  data-theme="auto"
  data-min-height="560"
></div>
<script src="https://bethemesh.com/widgets/v1/bethemesh.js" async></script>

Direct iframe

Use the direct iframe generated by the configurator.

HTML
<iframe
  src="https://bethemesh.com/en/embed/password-generator?theme=auto"
  title="Bethemesh widget"
  width="100%"
  height="560"
  loading="lazy"
  sandbox="allow-scripts allow-same-origin"
  style="border:0;display:block;width:100%"
></iframe>

Available options

AttributePurposeDefault
data-toolLocalized widget slug (required).
data-langEmbedded route locale.en
data-themeauto, light or dark theme.auto
data-titleCustom title, limited to 100 characters.Tool title
data-subtitleCustom subtitle, limited to 180 characters.
data-min-heightInitial height before automatic resize.560
data-loadinglazy or eager iframe loading.lazy

Events and automatic resize

The runtime creates the iframe, listens to signed Bethemesh messages and automatically adjusts its height. The public API can also initialize dynamically added widgets.

window.BethemeshWidgets.initialize()

CMS compatibility

WordPress / Elementor

Use a Custom HTML block.

Webflow / Wix

Paste the code into an Embed component.

Shopify

Add a Custom Liquid or HTML section.

HTML / Astro / React

Insert the container and load the script once.

Security

Permissions and sandbox tokens are generated from each tool’s declared capabilities. Do not manually broaden them without a real need.

Troubleshooting

Multiple widgets

Load bethemesh.js only once, even when the page contains several containers.

Dynamic content

Widgets added after page load are detected automatically. You may also call BethemeshWidgets.initialize().

External scripts blocked

Use the direct iframe generated by the configurator.