# Cloudflare Pages

MuxForms on Cloudflare Pages adds embed.js to your built HTML (Astro, Vite, or plain static). Allow https://your-project.pages.dev and your production custom domain on the form.

## Cloudflare Pages

| Topic | Note |
| --- | --- |
| Worker | Not required for embed |
| Preview URLs | Add each *.pages.dev preview origin if you test there |
| Build output | Put snippet in layout or template |
| CORS | Dashboard allowlist |

## Public contact page in your framework output

After `npm run build`, the HTML that Pages publishes should include:

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

## Custom domain

Once Cloudflare proxies your domain, add `https://www.example.com` to the MuxForms form allowlist.

## FAQ

### Preview deployments?

Either allow specific preview origins or test on production URL only.

### Astro on Pages?

Use /docs/astro—same allowlist rules.

### Workers later?

POST with ingest secret from a Worker if you outgrow public embed.

### 403 on pages.dev?

Origin must match allowlist exactly, including subdomain.

---

HTML version: https://www.muxforms.com/docs/cloudflare-pages
Source: MuxForms (https://www.muxforms.com)
