# t3-oss/t3-env

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/t3-oss-t3-env).**

3,782 stars · 119 forks · TypeScript · mit

## Links

- GitHub: https://github.com/t3-oss/t3-env
- Homepage: https://env.t3.gg
- awesome-repositories: https://awesome-repositories.com/repository/t3-oss-t3-env.md

## Description

t3-env is a type-safe environment manager and schema validator for TypeScript. It maps environment variables to static types to provide autocompletion and prevents configuration errors through a system that verifies required variables are present and correctly formatted before an application starts.

The project enforces strict variable scope to isolate server-side secrets from the client browser, preventing sensitive data from leaking into client-side bundles. It also provides configuration presets tailored to the naming conventions of specific hosting and deployment platforms.

The library integrates with schema validation libraries to ensure runtime integrity and uses a type-safe proxy interface to wrap environment objects. These mechanisms combine compile-time error detection with runtime validation to prevent deployment failures.

## Tags

### DevOps & Infrastructure

- [Type-Safe Configuration Managers](https://awesome-repositories.com/f/devops-infrastructure/type-safe-configuration-managers.md) — Provides a specialized manager for parsing and validating environment settings into structured, type-checked objects.
- [Static Type Checking](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/environment-management/environment-variable-management/typed-variable-hooks/static-type-checking.md) — Provides type checking for environment variables during development to ensure runtime stability and developer productivity. ([source](https://env.t3.gg/docs/introduction))
- [Deployment Environment Management](https://awesome-repositories.com/f/devops-infrastructure/deployment-environment-management.md) — Manages configuration settings across different deployment environments using structured presets.

### Development Tools & Productivity

- [Client-side Environment Variables](https://awesome-repositories.com/f/development-tools-productivity/client-side-environment-variables.md) — Manages the secure exposure of specific environment variables to client-side bundles while isolating secrets.
- [Server-Side Secret Guarding](https://awesome-repositories.com/f/development-tools-productivity/client-side-environment-variables/server-side-secret-guarding.md) — Blocks server-side variables from reaching the client and triggers errors if accessed in a browser context. ([source](https://env.t3.gg/docs))
- [Environment Variable Validation](https://awesome-repositories.com/f/development-tools-productivity/command-argument-parsers/environment-variable-configuration/environment-variable-validation.md) — Validates that required environment variables are present and correctly formatted before the application starts. ([source](https://cdn.jsdelivr.net/gh/t3-oss/t3-env@main/README.md))
- [Environment Variable Mapping](https://awesome-repositories.com/f/development-tools-productivity/environment-variable-mapping.md) — Binds environment variables to specific TypeScript types to catch configuration errors during compilation. ([source](https://cdn.jsdelivr.net/gh/t3-oss/t3-env@main/README.md))

### Programming Languages & Runtimes

- [Client-Server Isolation](https://awesome-repositories.com/f/programming-languages-runtimes/variable-scope-controls/client-server-isolation.md) — Enforces strict boundaries to ensure sensitive server-side secrets are never leaked into client-side bundles.
- [Typed Proxies](https://awesome-repositories.com/f/programming-languages-runtimes/class-member-access/object-member-access/typed-proxies.md) — Provides a type-safe proxy that wraps the global environment object to enforce strict typing on access.

### Security & Cryptography

- [Environment Variable Security](https://awesome-repositories.com/f/security-cryptography/environment-variable-security.md) — Isolates and protects sensitive configuration data by restricting access to server-side contexts. ([source](https://cdn.jsdelivr.net/gh/t3-oss/t3-env@main/README.md))
- [Secret Leak Prevention](https://awesome-repositories.com/f/security-cryptography/secret-leak-prevention.md) — Prevents sensitive credentials from leaking into the browser by isolating server-side secrets.

### Software Engineering & Architecture

- [Runtime Value Validation](https://awesome-repositories.com/f/software-engineering-architecture/runtime-value-validation.md) — Implements a runtime wrapper that validates environment variables against a schema before they are accessed by the application.
- [Environment Variable Validation](https://awesome-repositories.com/f/software-engineering-architecture/schema-based-state-validation/environment-variable-validation.md) — Provides a utility to verify that environment variables match a defined schema before application startup.
- [Schema-Driven Type Inference](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/schema-driven-type-inference.md) — Automatically derives TypeScript static type definitions from runtime validation schemas for environment variables.

### Data & Databases

- [Schema Validation Libraries](https://awesome-repositories.com/f/data-databases/schema-validation-libraries.md) — Integrates with various schema validation libraries to ensure the structural integrity of environment data. ([source](https://env.t3.gg/docs/standard-schema))
