Static Forms - Secure form backend and form endpoint for contact formsStatic Forms - Secure form backend and form endpoint for contact forms
  • Home
  • Features
  • Docs
  • Blog
  • Pricing
Register
  • Home
  • Features
  • Docs
  • Blog
  • Pricing
Documentation

Learn how to use Static Forms

  • Introduction
  • Quick Start
  • Basic Setup
  • How It Works
  • Form Basics
  • API Key
  • Redirects
  • Overview
  • Honeypot Field
  • reCAPTCHA
  • Cloudflare Turnstile
  • hCaptcha
  • ALTCHA
  • Overview
  • Application Forms
  • Form Submissions
  • Webhooks
  • Auto Responders
  • Custom Email Templates
  • AI Reply
  • CC Emails
  • Branding & Custom Domain
  • File Uploads
  • Domain Restriction
  • Custom Subjects
  • Reply-To Address
  • Overview
  • Slack
  • Discord
  • Make
  • n8n
  • Google Sheets
  • Notion
  • Airtable
  • Overview
  • React
  • Next.js
  • Vue.js
  • Angular
  • Svelte
  • Astro
  • Plain HTML
  • Netlify
  • Vercel
  • Cloudflare Pages
  • GitHub Pages
  • WordPress
  • Webflow
  • Wix
  • Complete Reference
  • Account Settings
  • Pricing Plans
  • Overage Billing
  • Common Issues
  • Debugging
  • CORS Issues
  • Email Delivery
  • FAQ
  • Get Support
  • Changelog
Support
Framework Guide

Next.js Integration

Integrate Static Forms with your Next.js application

Static Forms works seamlessly with Next.js. This guide covers integration with both the App Router (Next.js 13+) and Pages Router, including Server Actions and client-side approaches.

Environment Variables

First, add your API key to your environment variables:

Bash

Environment Variables

Use NEXT_PUBLIC_ prefix for client-side variables. For Server Actions, you can use regular environment variables without the prefix.

App Router (Next.js 13+)

With the App Router, you can use Server Actions or client components:

Server Action Approach

Use Server Actions for form handling (recommended):

TypeScript

Client Component Approach

For more control, use a client component:

TypeScript

Pages Router

For the Pages Router, use API routes or client-side submission:

API Route Approach

TypeScript

File Uploads

Handle file uploads with FormData:

TypeScript

Best Practices

Use Server Actions When Possible

Server Actions provide better security and don't expose API keys to the client.

Handle Loading States

Always show loading indicators and disable form fields during submission.

Provide User Feedback

Show success and error messages to keep users informed about submission status.

Previous
React
Next
Vue.js

Documentation

  • Introduction
  • Quick Start
  • Basic Setup
  • How It Works
  • Form Basics
  • API Key
  • Redirects
  • Overview
  • Honeypot Field
  • reCAPTCHA
  • Cloudflare Turnstile
  • hCaptcha
  • ALTCHA
  • Overview
  • Application Forms
  • Form Submissions
  • Webhooks
  • Auto Responders
  • Custom Email Templates
  • AI Reply
  • CC Emails
  • Branding & Custom Domain
  • File Uploads
  • Domain Restriction
  • Custom Subjects
  • Reply-To Address
  • Overview
  • Slack
  • Discord
  • Make
  • n8n
  • Google Sheets
  • Notion
  • Airtable
  • Overview
  • React
  • Next.js
  • Vue.js
  • Angular
  • Svelte
  • Astro
  • Plain HTML
  • Netlify
  • Vercel
  • Cloudflare Pages
  • GitHub Pages
  • WordPress
  • Webflow
  • Wix
  • Complete Reference
  • Account Settings
  • Pricing Plans
  • Overage Billing
  • Common Issues
  • Debugging
  • CORS Issues
  • Email Delivery
  • FAQ
  • Get Support
  • Changelog
Static Forms - Secure form backend and form endpoint for contact formsStatic Forms - Secure form backend and form endpoint for contact forms

The fastest way to add working contact forms to any website. No backend required.

Product

  • Features
  • Pricing
  • Documentation
  • Changelog

Resources

  • Blog
  • Examples
  • Templates
  • Tools
  • Integrations
  • reCAPTCHA Guide
  • FAQ

Alternatives

  • All Alternatives
  • Formspree
  • Netlify Forms
  • Typeform
  • Formspark

Company

  • Contact
  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA

© 2026 Static Forms. All rights reserved.

Committed to sustainability