Bolt contact form

Formgong team ·

Paste this into Bolt. Posts go to Formgong. No database and no Resend.

250 free submissions a month

How forms work in Bolt

Bolt runs a full development environment in the browser and can pick different stacks: Vite with React most often, but also Astro, Vue, Svelte or Next.js. When a project needs data, Bolt can create a database for you, so a simple contact form can quietly turn into tables, server code and secrets.

A Formgong form needs none of that. The form posts to https://formgong.com/submit from whatever frontend Bolt generated. The preview inside Bolt can send real test submissions, because Formgong accepts requests from any origin by default.

Set it up in Bolt

  1. Create a form in Formgong and copy the access key.
  2. Check which framework Bolt chose (look at package.json). The prompt below works for all of them; for Astro or a plain HTML page, a form with method="POST" and no JavaScript is enough.
  3. Paste the prompt into Bolt. It includes the endpoint, key, _lang and the hidden botcheck field, and asks Bolt not to create a database for the form.
  4. Send a test from the preview, then publish and test again on the live address. Bolt hosting gives you a bolt.host address; custom domains need a paid plan.
  5. Optional: add a note to Project Settings → Knowledge so later prompts keep posting to Formgong.

Step-by-step guide in the docs

Bolt
Add a contact form to this site. Submissions go to Formgong, a hosted form backend. Bolt: do not create a database table, Supabase project, or server function for this form.

Formgong spec (follow exactly):
- Plain HTML: <form action="https://formgong.com/submit" method="POST">. With JavaScript, POST the same fields to https://formgong.com/submit using fetch.
- Hidden field access_key with value fk_your_access_key. The key is public and belongs in frontend code. Do not move it to a server or a secret.
- Hidden field _lang with the page language code, e.g. "en" (on multilingual sites use document.documentElement.lang). Formgong uses it for error messages, the thank-you page, and the autoreply.
- Fields: name, email, message (required); phone is optional. Keep these field names, and use <input type="email"> for email so browsers check the address.
- Honeypot: <input type="text" name="botcheck" tabindex="-1" autocomplete="off"> inside a wrapper with aria-hidden="true", visually hidden with CSS (position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)). Never fill it.
- Success, plain form POST: optionally add a hidden _redirect field with the absolute https URL of the site's thank-you page. Without it, Formgong shows its own thank-you page.
- Success, fetch: send Accept: application/json (and Content-Type: application/json for a JSON body; for FormData let the browser set it). If the response has success === true, show an inline thank-you message and reset the form; otherwise show the response's message.
- Turnstile: only if I give you a Cloudflare Turnstile site key, add <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> and <div class="cf-turnstile" data-sitekey="SITE_KEY"></div> inside the form. Otherwise leave it out.
- Optional: add <script src="https://formgong.com/fg.js" async></script> once per page. It fills _lang from <html lang>, sets the Turnstile language, and counts form views without cookies.
- Do not create a backend, API route, server function, database table, or email-sending code (Supabase, Resend, SendGrid, nodemailer), and do not add secrets. No file uploads.

Ready React component on GitHub: github.com/formgong/react-contact-form. MIT license: click “Use this template” or copy the files.

React package: npm install @formgong/react (npm: @formgong/react)

Add to an existing project: npx formgong init (npm: formgong)

Formgong or a Bolt database?

A Bolt database is the right choice when the app itself reads the data back: orders, user profiles, anything with a screen of its own.

Formgong fits forms whose job is to reach a person: contact, quote or booking requests. Messages arrive by email and Telegram, spam is filtered, and nothing in the project has to be maintained.

Questions and answers

Does this work if Bolt generated Next.js or Astro instead of React?

Yes. The endpoint and fields are the same in every framework. Next.js needs a client component with fetch; Astro and plain HTML can post the form without JavaScript.

Can I test from the Bolt preview?

Yes. Formgong allows requests from any origin unless you set an allowed-domain list (every plan). Remember to add your published domain if you turn that list on.

Bolt created a database table for the form. Should I keep it?

Only if something in the app reads it. Otherwise ask Bolt to remove the table and the server code, and keep just the frontend form.

I deploy to Netlify. Should I use Netlify Forms instead?

Netlify Forms works only on Netlify hosting and needs the form detected at build time. Formgong works on any host and adds Telegram delivery; both are valid, so pick what matches your hosting.

Start free