Let your AI coding tool wire the site
You use ChatGPT, Claude, Cursor or Lovable and do not want to write the code yourself. Copilot gives you one prompt. Paste it into your tool, your tool wires the site, and the dashboard shows what happened.
Copy the prompt
Section titled “Copy the prompt”Open the form in your project and go to Connect. The prompt is there, already filled with that form’s address, its public key and its fields. Copy it and paste it into your AI coding tool, together with your site’s code or project.
This is the shape of it, for a form called “Landing page enquiry”. Yours comes filled with your own project’s details.
Connect a form on my website to Launchwing Copilot Forms. The form is "Landing page enquiry".
Post each submission to: https://api.copilot.launchwing.io/v1/public/forms/frm_8kQ2/submissionsPublic key (safe in browser code): pk_test_7Kq2mN9xR4vL8pW3sT6yB1cDMode: Test. No credits are used, and emails go only to the project's Test recipients. When the site goes live, swap in the Live keys from Copilot.
The form has these fields. Use each name exactly as written:- full_name (short text, required), labelled "Full name"- email (email, required), labelled "Email"- budget (dropdown): send one of "Under ₹50,000", "₹50,000 – ₹1,00,000", "Over ₹1,00,000", "Not sure yet" exactly- message (long text, required), labelled "What do you need?"- consent (consent checkbox): one checkbox with value="true"; unticked sends nothing. In JavaScript send true if ticked, false if not.
How to send it, either way works:- Plain HTML: <form action="https://api.copilot.launchwing.io/v1/public/forms/frm_8kQ2/submissions" method="POST"> with a hidden input named _launchwing_key set to the public key. The browser leaves the page on submit; what it shows next is set in the form's settings in Copilot.- JavaScript: POST JSON { "fields": { ...the values above }, "_gotcha": the honeypot value, "pageUrl": the page address } with the headers Content-Type: application/json and X-Launchwing-Key: the public key. If the reply is not OK, show error.message from the JSON reply and keep what the person typed. On success, show the reply's message and clear the form.- Either way, add a hidden text input named _gotcha, left empty and out of sight (display: none, tabindex -1, autocomplete off). It catches spam bots; keep it.
Rules:- Use only the public key above. Never put a secret key (sk_...) in website code.- Copilot only accepts posts from this project's allowed websites. If my site's address isn't allowed yet, tell me to add it in Copilot under API keys, or in this form's settings if the form has its own list.- Keep my site's existing design. Change only what is needed to connect the form.The name is the same in both environments. Set it to the Test secret key for local work and staging, and to the Live secret key in production only. Copy as .env on API keys gives you the file; keep it out of git.
# Server only. Never in browser code.COPILOT_SECRET_KEY=sk_test_…What the prompt does
Section titled “What the prompt does”- Tells your tool which form to connect and where each submission goes.
- Lists the fields with their exact names, so nothing arrives empty.
- Starts in Test, so no credits are used and email only reaches your Test recipients.
When the site is ready, swap in the Live public key. See Test and Live.
Check that it worked
Section titled “Check that it worked”- In the form’s Connect tab, use Send test submission. It is free.
- Open the form’s Submissions. The entry is there, marked Test.
- Put your site’s address under Allowed websites for Test, then send a real submission from your site. If it is refused with
origin_not_allowed, the address is missing from the list. See Allowed websites and API errors. - The request also appears in the project’s Logs.
If it does not work
Section titled “If it does not work”- The site’s request is refused with
origin_not_allowed. The site’s address is not on the allowed list. Add it under Allowed websites for the environment you are using. - The entry does not show in Submissions. Check you are looking at the same environment as the key in the prompt: the prompt starts in Test, so the entry is marked Test.
- You cannot tell what happened. Every request is listed in the project’s Logs with its status.
- A secret key (
sk_…) ended up in browser code or in a chat. Revoke it in API keys and create a new one. See Revoke a key.
Still stuck? Write to support@launchwing.io and quote the requestId from the error. See API errors.
If you would rather write the code
Section titled “If you would rather write the code”The prompt is a shortcut, not the only way. The form call is described in the API reference.
Copilot by Launchwing™
Sanish Krishnan Surya, Bangalore, Karnataka, India