Framework guide

Contact form for Gatsby without a backend

Gatsby produces static pages, while FormDrop handles the POST independently of your Gatsby host.

Where this goes

Save this as src/pages/contact.jsx to create a contact page.

Create a form in the dashboard and replace YOUR_FORM_ID with your endpoint ID. No account key belongs in this code.

export default function Contact() {
  return (
    <form action="https://formdrop.wouldairecommend.workers.dev/f/YOUR_FORM_ID" method="POST">
      <label htmlFor="email">Email</label>
      <input id="email" name="email" type="email" required />
      <label htmlFor="message">Message</label>
      <textarea id="message" name="message" required />
      <input name="_gotcha" tabIndex={-1} autoComplete="off" hidden />
      <button type="submit">Send message</button>
    </form>
  );
}

The detail that matters

No Gatsby Function or build-time API token is needed. Never embed your private access link in page data.

After you publish

Send a test from the published page, then check Inbox and Spam. Native forms follow a redirect; fetch clients must request JSON and show errors. Set your allowed domains to the hostnames you actually publish, including any preview hostname you need.

Read the endpoint reference for reserved fields, CORS and redirect rules. Start from the accessible contact template if you need styling.

Questions about this setup

Does Gatsby need its own backend?
No. The browser posts the named form fields to your FormDrop endpoint. Your site can stay static.
Will this send an email notification?
Email notifications are not switched on yet. Read submissions in the dashboard or connect Slack, Discord, Telegram or a webhook.
Can I attach a file?
File uploads: not yet. Text fields are saved; files are ignored and flagged in the dashboard. Link to an existing public document instead.