Build a typed contact form in TypeScript
Get end-to-end type safety from your form fields to the submission payload.
- 1
Install the SDK
Run `npm i @formloom/client`.
- 2
Declare your field types
Create a `type` describing your form's fields.
- 3
Create a typed form
Call `createForm<YourType>(accessKey)` — submit is now type-checked.
example.ts
import { createForm } from "@formloom/client";
type Contact = { name: string; email: string; message: string };
const form = createForm<Contact>("YOUR_ACCESS_KEY");
await form.submit({ name: "Ada", email: "ada@x.dev", message: "Hi" });FAQ
Compile-time errors if you send the wrong shape, plus typed responses — no untyped fetch strings.