Skip to content

Forms for static sites

Static hosting does not receive form posts. Postbag does, whichever host you use today or move to tomorrow.

Plain HTML

Use a standard form action and a redirect. After someone sends a message, they go straight to your thank-you page. No JavaScript or build step required.

fetch, React, Astro, Next.js

Choose a snippet for fetch, React, Astro, or Next.js. Next.js can send from the server if you prefer. Browser forms work too, and you choose which sites may use your form.

app/actions.ts
"use server"

export async function submitForm(formData: FormData) {
  await fetch("https://postbag.dev/s/fm_8f3kq2", { method: "POST", body: formData })
}

Keep your options open

Postbag works on Cloudflare Pages, Vercel, GitHub Pages, S3, a VPS, or several at once. If you move hosts, the form keeps the same address.

Questions, answered

Does Postbag work with Astro?
Yes. Use the HTML snippet for zero JavaScript, or choose the fetch snippet from your form's embed page.
Can I keep the submit URL secret?
No. It appears in the HTML by design. That is why your form has a spam trap, rate limit, allowed-site list, and Turnstile when you need it.

Give the form job to your agent.

It can build, wire and test the form before you even sign up. Claim it when it's worth keeping.