Embed SDK

Two lines of code. Any website.

The @formit/embed SDK renders your forms inline, as popups, or anywhere you need them. Lightweight, framework-agnostic, and developer-friendly.

Inline Embed

Drop a div with your form ID and a script tag. The form renders inline within your page layout.

<div data-formit-embed="your-form-id"></div>
<script src="https://embed.formitai.com/embed.js"></script>

Popup / Modal

Trigger forms as fullscreen overlays or slide-in panels. Perfect for lead gen on any page.

<script src="https://embed.formitai.com/embed.js"></script>
<script>
  FormitEmbed.popup("your-form-id");
</script>

Direct Link

Every published form gets a shareable URL on your custom subdomain (org.formitai.com/formId).

https://yourorg.formitai.com/abc123

Developer experience

Built for developers who ship fast

The embed SDK lives in this monorepo (packages/embed) and is published as a single JavaScript file. No build step required for consumers — just a script tag.

  • Event callbacks for open, submit, close
  • Hidden field injection for CRM/UTM tracking
  • Programmatic open/close control
  • TypeScript types included
  • Lightweight (~4KB gzipped)
  • No framework dependencies
TypeScript
import { FormitEmbed } from '@formit/embed';

// Open as popup on button click
document.getElementById('cta')
  .addEventListener('click', () => {
    FormitEmbed.popup('form-id', {
      hiddenFields: {
        utm_source: 'landing',
        plan: 'pro',
      },
      onSubmit: (data) => {
        console.log('Submitted:', data);
      },
    });
  });

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.