Menu

1 / 16

How to Send Next.js Form Submissions to Google Sheets Without a Backend

DEV Community·Allen Jones·6 months ago
#Lf6U0U8y
#part#how#option#form#formgrid
Reading 0:00
15s threshold

Building a contact form in Next.js is straightforward.

You create a form component, add your input fields, wire up some state with useState, and handle the submission with a fetch call. Clean. Predictable. Very Next.js.

But then comes the question every Next.js developer eventually faces:

Where does the data actually go?

The obvious answer is an API route. You create a pages/api/contact.ts file or an app/api/contact/route.ts file, write a handler that receives the submission, and then figure out how to store it somewhere. A database. A Google Sheet. An email. Something.

For a side project or a client site, that is a lot of infrastructure to set up and maintain just to collect a few contact form submissions. You need a database or a third-party email service. You need environment variables.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.