Skip to main content
Next.js App Router is a great fit for Formbase because server actions can submit on the server and return a clean JSON response. This avoids browser redirects and gives you full control over the UI. You can still submit from the client if you want, but server actions are the most reliable pattern.
1

Create a server action

Submit the form data from the server so Formbase returns JSON instead of a redirect.
This works for both text fields and file uploads.
2

Wire it to a client component

The form posts to your server action, which forwards the submission to Formbase.

Client-side alternative

If you must submit from the browser, treat a 303 response as success:
Server actions avoid CORS issues and give you a JSON response. Use them when possible.