View .md

The MuxForms website embed is a script that reads data-form-id, downloads your form schema, renders fields, validates input, and POSTs submissions to MuxForms. Add one div and embed.js on any HTML page, including WordPress, Next.js client routes, and static hosts.

Docs

Website embed

MuxForms fetches the form schema, renders fields, validates on the client, and POSTS to the ingest API. You do not host PHP or a serverless function.

Embed requirements

StepAction
1Create a form; copy the UUID
2Allow your site origin on the form
3Paste div + script tag
4Read submissions in the inbox

Install

Replace FORM_UUID with the id from your dashboard.

<div data-form-id="FORM_UUID"></div>
<script src="https://www.muxforms.com/embed.js"></script>

React, Next.js, and SPAs

embed.js watches the page for new [data-form-id] nodes (client-side navigation included). You can also call window.MuxForms.mount(el) after your framework renders.

import { MuxForm } from "@muxforms/react";

export default function Page() {
  return <MuxForm formId="FORM_UUID" />;
}

The @muxforms/react package lives in this repo under packages/react. Load the script once in your layout or let the component inject it.

Hosted link (no website)

On the form Install tab, enable a hosted page and share /f/your-slug. Same styling and submissions as the embed, with a QR code and social preview image for iMessage, Slack, or email.

Origins

Add the exact origin (scheme + host, no trailing slash) to limit which sites can load the embed in a browser, for example https://www.yoursite.com. This is CORS — it does not block curl or server scripts. Those clients need the per-form ingest secret from Settings.

The embed fetches a short-lived submit token with the schema, sends it on POST, and can show Cloudflare Turnstile when you configure keys on the form.

Styling

Appearance (colors, radius, fonts, submit label) is stored on the form. The embed applies those tokens so the widget can match the site without a custom CSS file.

Common questions

What URL loads the embed?
https://www.muxforms.com/embed.js — cache-friendly and CORS-enabled for browser use.
Does the embed work after client-side navigation?
Yes. embed.js observes new [data-form-id] nodes and can be called via window.MuxForms.mount.
Can I use React?
Use @muxforms/react or mount after render; see the embed docs code sample.
Why do I need an allowlist?
Browser submissions require your production origin on the form CORS allowlist.

Paste the tag. Watch the inbox.

Create a form, allow your origin, embed the script.

Upgrade to Pro