Introduction
Validate and secure environment variables in Nuxt applications.
This integration requires ArkType to be installed.
The @arkenv/nuxt integration provides end-to-end environment validation for both the server and the browser. It automatically injects your configuration into Nuxt's runtimeConfig, catching configuration bugs early and preventing sensitive server-side variables from ever reaching the client via a custom Vite plugin.
Quickstart
The fastest way to get started is with the ArkEnv CLI. It automatically configures @arkenv/nuxt for your existing Nuxt project.
npx @arkenv/cli@latest initpnx @arkenv/cli@latest inityarn dlx @arkenv/cli@latest initbunx @arkenv/cli@latest initLayout strategies
ArkEnv supports two layout structures to match your security and developer experience preferences:
Simple layout (recommended)
Define client and server schemas in a single file (env.ts) to prioritize developer experience (DX).
Strict layout
Separate client and server schemas into different files to prioritize strict compile-time security.