Configure security headers for your Next.js app and get copy-paste ready next.config.ts code. Choose a preset or customize each header individually.
Forces HTTPS for all future visits. Essential for production.
Prevents clickjacking by controlling iframe embedding.
Prevents MIME-type sniffing. Always enable this.
Controls how much referrer info is sent with requests.
Restrict browser features. Check features to block.
Controls which resources can load. Powerful but complex.
Edit directly or use Strict/Moderate presets as a starting point.
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), payment=(), usb=(), bluetooth=(), magnetometer=(), gyroscope=(), accelerometer=()',
},
{
key: 'Content-Security-Policy',
value: "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'",
},
],
},
]
},
}
export default nextConfigAdd the headers() function to your existing next.config.ts, or use this as a starting point. Test your deployed headers at securityheaders.com.
Stripe Fee Calculator
Calculate Stripe fees for any payment method and currency.
RLS Policy Generator
Generate Supabase Row Level Security policies with templates.
SaaS Pricing Calculator
Find your break-even price and suggested pricing tiers.
OG Image Preview
Preview meta tags on Google, Twitter, LinkedIn, and more.
Security Checklist
30 essential security checks with scoring and progress tracking.
Tech Stack Costs
Compare hosting, database, and service costs at scale.
Security Headers
Generate Next.js security headers config with copy-paste code.
Skip months of boilerplate. SecureStartKit gives you auth, payments, email, and security best practices out of the box.
Get SecureStartKit