Server routes are optional for contact forms
Nuxt makes it easy to add server/api handlers - and easy to overbuild. For many marketing and product sites, a contact form only needs a reliable form API and email and WhatsApp delivery from one credit pool, not a custom mail stack. Credits meter usage across channels.
Platform notes
- Use named inputs and
@submit.preventas in the snippet. - Keep the form in a reusable component under
components/. - See the Vue page for pure Vite SPA notes without Nuxt conventions.
Troubleshooting
- Hook fails in setup: Confirm
@formsreach/vueis installed and imported correctly. - Empty payload: Ensure inputs have
nameattributes. - Hydration warnings: Keep the form interactive client-side; avoid mismatched server HTML for controlled inputs you do not need.