# next-safe-env ## Docs - [createEnv() configuration reference](https://next-safe-env.dev/api/create-env.md): Complete reference for createEnv(), including all config options: server, client, runtimeEnv, adapter, skipValidation, and onValidationError. - [TypeScript types exported by next-safe-env](https://next-safe-env.dev/api/types.md): Reference for types exported by next-safe-env: ServerOnly, ClientEnv, InferEnv, EnvConfig, ValidationFailure, ValidationStats, FieldValidator, and Adapter. - [Validator reference: str, num, bool, url, port](https://next-safe-env.dev/api/validators.md): Reference for next-safe-env validators. Covers str, num, bool, url, and port - including chainable methods, TypeScript type effects, and coercion behavior. - [Adapters: Next.js, Node.js, Edge Runtime, and Vite](https://next-safe-env.dev/concepts/adapters.md): next-safe-env adapters handle runtime-specific rules like NEXT_PUBLIC_ enforcement and server var stripping. Adapters are auto-detected or set explicitly. - [Validation errors and custom error handlers](https://next-safe-env.dev/concepts/error-handling.md): next-safe-env collects all validation failures before exiting, printing a complete error list. Customize behavior with onValidationError for structured logging. - [Server and client environment variable split](https://next-safe-env.dev/concepts/server-client-split.md): next-safe-env enforces a strict server/client split to prevent secrets from leaking into browser bundles, backed by TypeScript branding and runtime stripping. - [Use next-safe-env in Edge Runtime and Middleware](https://next-safe-env.dev/guides/edge-runtime.md): Validate env vars for Vercel Edge Runtime and Next.js Middleware. Only NEXT_PUBLIC_ variables are available at runtime in the edge environment. - [Use next-safe-env in a Next.js App Router project](https://next-safe-env.dev/guides/nextjs.md): Set up typed, validated environment variables in Next.js with automatic NEXT_PUBLIC_ prefix enforcement and server/client bundle separation. - [Use next-safe-env in a Node.js application](https://next-safe-env.dev/guides/nodejs.md): Validate env vars in any Node.js app using next-safe-env. Numbers coerce from strings; missing required vars exit the process before serving. - [Skip env validation in test environments](https://next-safe-env.dev/guides/testing.md): Set skipValidation to let test suites run without all env vars present. Field validation is skipped; raw string values are returned in the typed shape. - [Use next-safe-env in a Vite project](https://next-safe-env.dev/guides/vite.md): Validate import.meta.env variables in Vite with next-safe-env. The vite adapter enforces VITE_ prefixes and keeps server vars out of the browser bundle. - [Use Zod schemas with next-safe-env](https://next-safe-env.dev/guides/zod-interop.md): Pass z.object() schemas directly to createEnv if your project already uses Zod. No peer dependency required - next-safe-env duck-types Zod at runtime. - [next-safe-env: typed env vars for Next.js](https://next-safe-env.dev/introduction.md): next-safe-env validates env vars at startup with full TypeScript inference. Zero dependencies, under 5 kB. Supports Next.js, Node.js, Edge, and Vite. - [Get started with next-safe-env](https://next-safe-env.dev/quickstart.md): Install next-safe-env and define your first typed, validated environment schema in under 5 minutes, with automatic startup crash on missing vars.