A Gatsby contact form without Gatsby Functions
Your Gatsby site stays static. The form posts to a Formbold endpoint, so there's no Gatsby Function or serverless handler to write, and each entry reaches your inbox.
What does the Gatsby component look like?
A React component for src/components/ContactForm.tsx. It sends the fields with fetch and shows a status line. Import it into any page under src/pages and replace FORM_ID.
How do I add a contact form to Gatsby?
Three steps, and nothing changes in gatsby-config.
Set up a form in Formbold
Sign up, then Create New Form. Free allows 10 forms and 250 submissions a month.
Add the endpoint to the component
Replace the placeholder URL in the fetch call with https://formbold.com/s/FORM_ID from Form Setup.
Test in gatsby develop
Submit once on localhost:8000 and check Submissions before you deploy.
What does Formbold take off your plate?
The server side of the form. Gatsby keeps building static pages, and Formbold stores, filters and delivers the entries.
No Gatsby Functions
Nothing in src/api, so the site can live on any static host.
Captcha for a fetch form
This component submits with fetch, so pair Basic Spam Filter with Custom reCAPTCHA and your own v2 keys.
File uploads
Starter and higher. Send FormData instead of JSON so the files come along.
Leads into HubSpot or Sheets
Starter and higher send entries to HubSpot, Google Sheets, Slack, Zapier or Make, or to a webhook.
Builds, hosting and files
Mostly questions about builds and hosting.
Still have a question?
The docs cover setup, framework guides, integrations and spam protection, step by step.