Lovable contact form

Formgong team ·

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

250 free submissions a month

How forms work in Lovable

Lovable builds React apps with Vite and Tailwind. Ask it for a contact form and it often builds its own backend. That means a table in Lovable Cloud or Supabase, plus an edge function that sends email through Resend with a secret API key. That works, but you then own a database table, a function and an email account just to read messages.

With Formgong the form posts straight from the browser to https://formgong.com/submit. Lovable only writes the frontend component. There is no table, no edge function and no secret, and each lead arrives by email and in Telegram, with a copy in the Formgong inbox.

Set it up in Lovable

  1. Create a form in the Formgong dashboard and copy its access key (it starts with fk_).
  2. Paste the prompt below into the Lovable chat. It names the endpoint, the key, the _lang field and the hidden botcheck honeypot, and tells Lovable not to add a backend.
  3. Check the change Lovable made: the form component should call fetch on formgong.com/submit. If you see a new table, an edge function or a Resend secret, ask Lovable to remove them.
  4. Publish, send a test message from the live site and open it in the Formgong inbox. Then connect Telegram in the form settings.
  5. Optional: add one line to Project settings → Knowledge, such as “Forms post to Formgong; never add a backend for forms”. Later edits then keep the setup.

Step-by-step guide in the docs

Lovable
Add a contact form section to this site. Submissions go to Formgong, a hosted form backend, which emails them to the site owner. Lovable: do not enable Supabase, Edge Functions, or Resend 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 Lovable project: lovable.dev. Open it, click Remix, then put your access key in src/components/ContactForm.tsx.

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)

Formgong or Lovable Cloud?

Keep the form inside Lovable Cloud or Supabase when submissions are part of your app's own data. An example is a signed-in user's request that other screens read and update.

Use Formgong when the form is a way to reach you: contact, quote or booking requests from visitors. You get delivery to email and Telegram, spam filtering and an inbox with statuses without building an admin page.

Questions and answers

Do I need Lovable Cloud or Supabase for this form?

No. The browser sends the form to Formgong, so the project needs no database, edge function or email provider for it. You can still use Lovable Cloud for other parts of the app.

Is it safe to put the access key in the frontend code?

Yes. The access key is public by design: it only allows sending submissions to your form. Spam filtering is always on, and on every plan you can limit the form to your own domains.

Lovable added Resend anyway. What do I do?

Ask it to delete the edge function and the secret, and to keep only the fetch call to formgong.com/submit. Adding the rule to Project Knowledge stops it from coming back in later edits.

Will the form keep working after I edit the app?

Yes, as long as the component still posts the same fields. Settings such as recipients, Telegram and redirects live in Formgong and change without republishing the app.

Start free