A type-safe configuration toolkit for Next.js. Simplifies managing environment variables, runtime options, and shared settings across projects, ensuring safety and consistency in production.
Type-safe environment variables and runtime configuration patterns for Next.js applications
A powerful utility package that provides type-safe environment variables and flexible configuration patterns for Next.js applications. Built with TypeScript and Zod for maximum type safety and runtime validation.
Features
🔍 Type-safe Environment Variables: Validate and type-check your environment variables using Zod schemas
🛡️ Runtime Validation: Catch environment variable errors early with detailed validation messages
🔌 Plugin System: Extensible plugin architecture for Next.js configuration
📝 Development Feedback: Clear console output of validated environment variables during development
🎯 TypeScript First: Full TypeScript support with comprehensive type definitions
🚀 Zero Runtime Overhead: Minimal impact on production builds
Installation
API Reference
createNextConfig
Creates a normalized Next.js configuration by applying a series of plugins.
createNextConfigEnv
Validates and type-checks environment variables using Zod schemas.
Example Usage
Here's a complete example showing how to use both features together: