Skip to main content

Next.js Configuration

Learn how to configure Next.js for your FSS frontend application.

Basic Configuration

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,

// Image optimization
images: {
domains: ['localhost', 'your-domain.com'],
formats: ['image/avif', 'image/webp'],
},

// API rewrites
async rewrites() {
return [
{
source: '/api/:path*',
destination: `${process.env.NEXT_PUBLIC_API_URL}/:path*`,
},
];
},

// Environment variables
env: {
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
},
};

module.exports = nextConfig;

Environment Variables

VariableDescriptionRequired
NEXT_PUBLIC_API_URLBackend API URLYes
NEXT_PUBLIC_APP_URLFrontend URLYes
NEXT_PUBLIC_ENABLE_MFAEnable MFANo
NEXT_PUBLIC_ENABLE_RECAPTCHAEnable reCAPTCHANo