t3-env is a TypeScript package that validates environment variables at runtime and compile time using schema validation.
The problem it solves is preventing deployments with invalid or missing environment variables. It works by letting you define a schema for your environment variables using any Standard Schema compliant validator such as Zod or Valibot, then checking that actual environment variables match that schema. The package supports the full power of these validators, including transforms and default values, and provides autocompletion and type inference when you use the schema in your application.
You should choose this tool if you want type-safe environment variable handling with validation that catches configuration errors before deployment. It suits any TypeScript project that needs to ensure environment variables are present and correctly typed. The package is ESM only and requires a TypeScript configuration with appropriate module resolution settings.
The project typically responds to issues and pull requests within one to two weeks. Work in the issue tracker centers on pull requests, bug reports, and questions from users.