Docs / Astro
An Astro contact form with no server
ContactForm.astro matches Astro's philosophy: static, accessible HTML with a small vanilla enhancement script — no framework island, no hydration cost. Without JavaScript the form still posts normally and lands on a hosted confirmation page.
1 — Create the endpoint
curl https://api.conform.centrst.com/v1/routes \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","alias":"Contact"}'
2 — Fetch the component
curl 'https://api.conform.centrst.com/v1/routes/YOUR_FORM_ID/install?framework=astro&raw=1' > src/components/ContactForm.astro
---
import ContactForm from '../components/ContactForm.astro';
---
<ContactForm />
3 — Verify and prove
Confirm the verification email in the destination inbox, then send a marked test submission — the response returns test: true as proof:
curl -sS -X POST https://api.conform.centrst.com/f/cfm_7K4P9X2M8RWD3JNH \
-d 'name=Test&[email protected]&message=Hello from a test&_test=true'