DropForm with Astro

Add a contact form to an Astro site and submit to DropForm with a plain HTML form or fetch. Great for static sites.

This guide shows how to integrate DropForm with Astro using the Submission API: POST https://api.dropform.app/s/{uid}.

  • plain HTML form (simplest)
  • optional fetch submit (stay on page)

What you need

  • Your DropForm form UID (endpoint: https://api.dropform.app/s/{uid})
  • An Astro project

Option A: Plain HTML form (recommended)

Astro renders HTML by default, so the simplest integration is a normal form POST. This avoids CORS and works everywhere.

Option B: Fetch (optional)

Use fetch when you want inline success/error messages without navigating away.

Common gotchas

  • Don’t set Content-Type for FormData: the browser sets the boundary.
  • Use HTML form when possible: it’s the most reliable on static hosts.
  • Files: use multipart/form-data (FormData or HTML enctype).

Next steps