Nuxt contact form with nothing in server/api
Skip server/api. A Nuxt component can post straight to your Formbold endpoint with $fetch, and each submission is stored and emailed. It works with nuxi generate static builds too.
The component
A single-file component for components/ContactForm.vue with <script setup>, reactive form state and $fetch. Nuxt auto-imports ref, reactive and $fetch, so there are no import lines. Replace FORM_ID.
Setting it up in Nuxt
Create the form, paste the endpoint, test it in dev.
Create a form
Click Create New Form in Formbold. You can have 10 on Free.
Point $fetch at Formbold
Use your https://formbold.com/s/FORM_ID address, from the Form Setup tab, as the $fetch URL.
Test with npm run dev
Submit once on localhost:3000 and check Submissions.
What does Formbold handle for a Nuxt app?
The request after submit. Nitro doesn't have to run anything for your form.
No server/api route
Nothing for Nitro to handle, so nuxi generate and static hosting work.
Spam checks for $fetch submits
Turn on Basic Spam Filter. $fetch counts as a script submit, so use Custom reCAPTCHA if you want a captcha.
File uploads
Starter and higher. Send a FormData object as the body when the form has a file input.
Slack, Telegram or Discord
From Starter, the Integrations tab forwards each entry to chat apps, Notion, Google Sheets or a webhook.
Nuxt questions
Server routes, static builds and $fetch.
Still have a question?
The docs cover setup, framework guides, integrations and spam protection, step by step.