Hosting and deploy platforms
Add a contact form to Vercel
Vercel will happily run a serverless function to handle your form, and it will also happily count every submission against your function invocations, cold-start it, and leave you to solve spam and email delivery yourself. Posting straight to a form endpoint skips all of that. Nothing to deploy, nothing to configure, and it works the same on a Hobby project as on Enterprise.
Setup
Create a form and copy the endpoint
Nothing to add to your Vercel project settings.
Point your form at it
Client-side fetch or a native POST - both work regardless of framework.
Optionally set the endpoint per environment
Add a NEXT_PUBLIC_ variable in Vercel if you want preview deploys to use a separate form from production.
Vercel examples
Swap in your own endpoint and these run as-is.
No API route, no function invocation.
export default function ContactPage() {
return (
<form action={process.env.NEXT_PUBLIC_FORM_ENDPOINT} method="POST">
<input name="name" required />
<input name="email" type="email" required />
<textarea name="message" required />
<input type="hidden" name="_next" value="https://example.com/thanks" />
<button type="submit">Send</button>
</form>
);
}Set per environment in Project Settings so previews do not pollute your production inbox.
# Production NEXT_PUBLIC_FORM_ENDPOINT=https://send.webforms.to/wft_your_key # Preview - point at a second form so test submissions stay separate NEXT_PUBLIC_FORM_ENDPOINT=https://send.webforms.to/wft_your_preview_key
Worth knowing
- Submissions never touch your Vercel functions, so they do not count toward function invocations or execution time on any plan.
- Restrict the form to your production domain in the dashboard. Add your *.vercel.app preview domain too if you want previews to submit.
Vercel form FAQ
No. The browser posts directly to the endpoint, so there is no function to write, deploy, cold-start or pay for.
No. The request never reaches your Vercel deployment.
Yes. If you have restricted the form to specific domains, add your preview domain to the allowlist, or point previews at a second form using a per-environment variable.
Related guides
Ready to wire up your Vercel form?
Free for 300 submissions a month. Endpoint in under a minute, no card required.
Start free