Form in Lovable
The prompt already includes the key, the endpoint, and the honeypot. Do not add Supabase or a Resend call. Lovable should not create a backend.
- Get an access key on the homepage.
- Open the Lovable project.
- Paste the prompt below.
- Send a test submission and open it in the Formgong dashboard.
- Connect Telegram from the form settings.
Prompt
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. Required: directly under the submit button, add a small, muted link to Formgong, exactly <p class="fg-credit"><a href="https://formgong.com/en/?ref=badge&utm_source=badge&utm_medium=form&utm_campaign=prompt" target="_blank" rel="noopener">Form by Formgong</a></p> Keep it visible on the page.
Minimal code
React component
"use client";
import { useState } from "react";
export function ContactForm() {
const [status, setStatus] = useState("");
async function onSubmit(event) {
event.preventDefault();
const fields = Object.fromEntries(new FormData(event.currentTarget));
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify({ _lang: "en", ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
setStatus(result.message || (result.success ? "Sent. Thank you!" : "Could not send. Please try again."));
}
return (
<form onSubmit={onSubmit}>
<label>Name <input name="name" placeholder="Your name" required /></label>
<label>Email <input name="email" type="email" placeholder="you@example.com" required /></label>
<label>Message <textarea name="message" placeholder="How can we help?" required /></label>
<div aria-hidden="true" style={{ position: "absolute", insetInlineStart: 0, top: 0, width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }}>
<input name="botcheck" tabIndex={-1} autoComplete="off" />
</div>
<button type="submit">Send</button>
<p role="status">{status}</p>
</form>
);
}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)
Before you publish
- The form posts to https://formgong.com/submit (form action or fetch URL).
- access_key holds your key from the Formgong dashboard, not fk_your_access_key.
- A hidden, empty botcheck field is present.
- _lang matches the page language.
- No API route, server function, database table, or secret was added for the form.
- A test submission shows up in the Formgong inbox. Telegram (if connected) and email arrive at once, on Free too.
What Lovable tends to get wrong
Asked for "a contact form that emails me", Lovable often turns on Supabase and writes an Edge Function that calls Resend. That needs a Resend account, a verified domain and secret keys, and it breaks quietly when one of them is missing. The prompt tells Lovable not to do this. The form posts straight from the browser to Formgong, which stores the message and sends the email.
Lovable also likes to show a "Thanks!" toast before the request has finished. The prompt asks it to wait for success: true and to show the server's error message otherwise, so a failed send never looks like a success.
For agents: connect the MCP server
Lovable: Connectors → + → MCP server. Name: Formgong. Enter the URL, keep Direct connection and OAuth, then click Add & authorize. Sign in to Formgong and approve the permissions. Alternatively, choose Bearer token or API key and paste only your personal token.
Lovable MCP settings
URL: https://formgong.com/mcp Authentication: OAuth Add & authorize → Formgong
Prompt for an agent with MCP
With the MCP server connected, this prompt lets the agent find your form and key on its own:
Use the Formgong MCP server to add a working contact form to this site. 1. Call list_forms. If there is no form for this site, call create_form with the site name. 2. Call get_form_snippet with that form_id and framework "react" (use "html" for a static page, "next" for the Next.js App Router). 3. Add the returned code as the contact form, styled like the rest of the site. Keep access_key, _lang and the botcheck honeypot exactly as returned. 4. Do not add a backend, API route, database or email code, and never write the fgp_ token into project files.
Check the result
- Open the published site, not only the preview, and send a test message with your own email.
- Find the message in your Formgong inbox.
- Check that Lovable did not add Supabase, an Edge Function or a RESEND_API_KEY secret for the form.
- Run the form checker on the published address.
The form checker reads the published page and lists concrete problems, such as a missing name attribute or a placeholder key.
Questions
Does the Lovable preview send real submissions?
Yes. A new Formgong form accepts submissions from any website, so the preview works. If you later limit the form to your own domains, test on the published site or add the preview domain too.
Can I keep Supabase for the rest of my Lovable app?
Yes. The prompt only keeps the contact form off Supabase. Your login, data and other features stay as they are.
Is the access key in the prompt a secret?
No. The access key (fk_…) is public by design. It can only send submissions to one form, which anyone can already do on your site. Secrets, such as a Turnstile secret key or a Formgong API token (fgp_…), must never go into a prompt or frontend code.
How do I put my real key into the prompt?
Copy it from your Formgong dashboard and replace fk_your_access_key. If you are signed in, use the button under the prompt. It reads your forms from your own dashboard in the browser and swaps the key in. Nothing is sent to the AI tool until you paste the prompt.