MuxForms on SvelteKit loads embed.js in src/app.html or +layout.svelte, uses onMount in +page.svelte to call MuxForms.mount, and allowlists your deployed origin (Vercel, Netlify, or Cloudflare).
Docs
SvelteKit client navigations need a fresh mount when users land on /contact without a full reload.
| File | Role |
|---|---|
| app.html | Global script tag |
| routes/contact/+page.svelte | Mount target |
| +page.server.ts | Optional server POST |
| adapter | Public URL → allowlist |
<script lang="ts">
import { onMount } from "svelte";
let root: HTMLDivElement;
onMount(() => {
if (root) window.MuxForms?.mount(root);
});
</script>
<h1>Contact</h1>
<div bind:this={root} data-form-id="FORM_UUID"></div>%sveltekit.body% <script src="https://www.muxforms.com/embed.js" defer></script>
Server actions optional—embed is the fast path.
Upgrade to Pro