Browse and search developers

Embed SDK

Install the embed snippet

Create an embed in Share, copy the two-line snippet, and paste the container div and embed.js script tag into your page or site builder.

On this page
  1. Create an embed and copy the code
  2. The snippet
  3. Placement rules
  4. Site builders
  5. Check the install

Installing an embed takes two lines of HTML: a container element that carries the embed id, and the script tag that loads embed.js. The app generates both for you.

Create an embed and copy the code

  1. Publish the form. Embeds only load for published forms.
  2. In the form builder, open the Share tab and choose Embed in a web page.
  3. Click New embed, or select an existing embed from the list.
  4. On the Design tab, pick an Embed mode and adjust its settings. The Advanced tab holds URL parameter settings.
  5. Optionally rename the embed, then click Apply changes to save.
  6. Click Get the code. The "Embed your form" dialog shows the snippet and steps for WordPress, Squarespace, Webflow, Shopify or "Other embeds". Copy the snippet.

The snippet

HTML
<div data-formit-embed="YOUR_EMBED_ID"></div>
<script src="https://embed.formitai.com/embed.js?v=7"></script>

YOUR_EMBED_ID stands for the embed id the dialog fills in. The ?v=7 value is the current script version, so always copy it from the dialog instead of typing it.

PartWhat it does
<div data-formit-embed="...">Marks where the embed mounts. For Standard the iframe renders inside this element. Popup and slider modes render their launcher button here. Full page, popover and side tab attach fixed-position elements to the viewport, so the div’s position on the page matters less.
<script src=".../embed.js?v=7">Loads the SDK. On load it mounts every [data-formit-embed] element already in the page.

Placement rules

  • Put the div where you want the form, and load the script once per page. The script mounts all embed divs on the page, so several embeds can share one script tag.
  • If the script runs while the page is still loading, it waits for DOMContentLoaded and then mounts every embed div in the HTML. If it runs later (for example, injected by a tag manager), it mounts the divs that exist at that moment.
  • Elements added later, for example by a single-page app, are not picked up automatically. Call FormitEmbed.init() after adding them. See the frameworks guide.
  • Each element mounts once. The SDK marks mounted elements with data-formit-mounted, and scanning again skips them.

Site builders

The dialog’s platform steps boil down to pasting the snippet into a raw HTML element. In WordPress use a Custom HTML block, in Squarespace a Code block, in Webflow an Embed element, and in Shopify a theme template or custom liquid section.

Check the install

  • Open the page and confirm the form or launcher appears. "Unable to load form embed." means the configuration request failed. Check that the form is published and the embed id is correct.
  • In the browser console, [FormitEmbed] messages show the underlying error.
  • After changing embed settings, reload the page. You do not need to re-copy the snippet unless the dialog shows a newer ?v= value.

Ready?

Build your first AI form in minutes.

No credit card. Generate from a prompt, enable follow-ups, and publish a link or embed the same day.