# FormLoom — full integration reference This file inlines the canonical copy-paste snippet for each framework so an LLM can emit correct FormLoom code with zero fetches. Replace YOUR_ACCESS_KEY with a real form id (the public access key, safe to commit). Mint one at https://formloom.ai/signup or POST to /api/keys with an email. ## Endpoint POST https://api.formloom.ai/submit/YOUR_ACCESS_KEY Headers: Content-Type: application/json, Accept: application/json Response: { success: boolean, message: string, id: string } ## Next.js (Server Action (recommended)) File: app/contact/page.tsx ```tsx // app/contact/page.tsx — Next.js 15 App Router, Server Action export default function ContactPage() { async function submit(formData: FormData) { "use server"; const res = await fetch("https://formloom.vercel.app/api/submit/YOUR_ACCESS_KEY", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, body: JSON.stringify(Object.fromEntries(formData)), }); // FormLoom scores spam, stores the row, and emails you — no backend to wire. return res.json(); } return (
); } ``` ## Astro (Astro page (static)) File: src/pages/contact.astro ```astro --- // src/pages/contact.astro — static, no server needed --- ``` ## SvelteKit (SvelteKit page) File: src/routes/contact/+page.svelte ```svelte {#if status === "ok"}Thanks — we got your message.
{:else} {/if} ``` ## React (React component (client)) File: ContactForm.tsx ```tsx // ContactForm.tsx — React (works in Vite, CRA, Next 'use client') "use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "ok" | "error">("idle"); async function onSubmit(e: React.FormEventThanks — we got your message.
; return ( ); } ``` ## Vue (Vue 3 single-file component) File: ContactForm.vue ```vueThanks — we got your message.
``` ## Svelte (SvelteKit page) File: src/routes/contact/+page.svelte ```svelte {#if status === "ok"}Thanks — we got your message.
{:else} {/if} ``` ## Nuxt (Vue 3 single-file component) File: ContactForm.vue ```vueThanks — we got your message.
``` ## Remix (React component (client)) File: ContactForm.tsx ```tsx // ContactForm.tsx — React (works in Vite, CRA, Next 'use client') "use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "ok" | "error">("idle"); async function onSubmit(e: React.FormEventThanks — we got your message.
; return ( ); } ``` ## Gatsby (React component (client)) File: ContactForm.tsx ```tsx // ContactForm.tsx — React (works in Vite, CRA, Next 'use client') "use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "ok" | "error">("idle"); async function onSubmit(e: React.FormEventThanks — we got your message.
; return ( ); } ``` ## Hugo (Plain HTML (no JavaScript)) File: contact.html ```html ``` ## Eleventy (Plain HTML (no JavaScript)) File: contact.html ```html ``` ## Jekyll (Plain HTML (no JavaScript)) File: contact.html ```html ``` ## SolidJS (React component (client)) File: ContactForm.tsx ```tsx // ContactForm.tsx — React (works in Vite, CRA, Next 'use client') "use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "ok" | "error">("idle"); async function onSubmit(e: React.FormEventThanks — we got your message.
; return ( ); } ``` ## Qwik (React component (client)) File: ContactForm.tsx ```tsx // ContactForm.tsx — React (works in Vite, CRA, Next 'use client') "use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "ok" | "error">("idle"); async function onSubmit(e: React.FormEventThanks — we got your message.
; return ( ); } ``` ## Angular (Angular standalone component) File: contact.component.ts ```ts // contact.component.ts — Angular standalone component import { Component } from "@angular/core"; import { FormsModule } from "@angular/forms"; @Component({ selector: "app-contact", standalone: true, imports: [FormsModule], template: ` `, }) export class ContactComponent { async submit(value: RecordThanks — we got your message.
; return ( ); } ``` ## VitePress (Vue 3 single-file component) File: ContactForm.vue ```vueThanks — we got your message.
``` ## Laravel (Plain HTML (no JavaScript)) File: contact.html ```html ``` ## MCP server Add to your AI coding tool: ```json { "mcpServers": { "formloom": { "command": "npx", "args": [ "-y", "@formloom/mcp" ] } } } ``` Then call get_snippet({ framework, fields }) to receive framework-correct code with a provisioned key. Last verified: June 2026