Introduction

Validate and secure your Next.js environment variables with zero-boilerplate scaffolding and a seamless developer experience.

This integration requires ArkType to be installed.

The @arkenv/nextjs integration provides end-to-end environment validation for both the server and the browser. It catches configuration bugs early in your build pipeline and prevents sensitive server-side variables from ever reaching client components.

Quickstart

The fastest way to get started is with the ArkEnv CLI. It automatically configures @arkenv/nextjs for your existing Next.js project.

npx @arkenv/cli@latest init
pnpm dlx @arkenv/cli@latest init
yarn dlx @arkenv/cli@latest init
bunx @arkenv/cli@latest init

Layout strategies

ArkEnv supports two layout structures to match your security and developer experience preferences:

Next steps