t3-env

Validate VITE_* environment variables at build time with a Zod schema.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill t3-env
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: t3-env
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/t3-env
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill t3-env

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

client-side VITE_* environment variables were not validated at build time in dean-stack, risking runtime errors and misconfigurations on GitHub Pages. This skill provides a deterministic, static-gate approach that validates env definitions before publish.

Core Features & Use Cases

  • Validate VITE_* env variables at build time using a Zod-based schema in @t3-oss/env-core.
  • Maintain a client/server split with an empty server slot for GitHub Pages static deployment.
  • Integrate with the dean-stack setup by wiring into apps/web/app/env.ts and the Vite config to gate builds.

Quick Start

Wire in the env core by updating apps/web/app/env.ts and run bun run build to validate VITE_* at build time.

Frequently Asked Questions about t3-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate VITE environment variables at build time?

You validate VITE environment variables at build time by applying a Zod-based schema via @t3-oss/env-core and gating the build process. This catches invalid or missing environment variables before deployment.

Why does my Vite app fail on GitHub Pages due to missing env variables?

Vite apps fail on GitHub Pages when client-side VITE_* variables are not validated at build time, causing runtime errors. This issue is prevented by enforcing a deterministic build gate that validates env definitions before publish.

Can I use t3-oss env validation for a static GitHub Pages deployment?

Yes, t3-oss env validation supports static GitHub Pages deployment by maintaining a client/server split with an empty server slot. This ensures only client-side VITE_* variables are processed for static hosting.

How do I wire Zod schema validation into a Vite config?

Wire Zod schema validation into a Vite config by updating your env.ts file to define the schema using @t3-oss/env-core. Run your build command, such as bun run build, to trigger the validation gate.

What are the limitations of build-time env validation for Vite?

The limitation of build-time env validation for Vite is that it only checks variables during the build process, not at runtime. It requires a deterministic build gate like bun run build to catch misconfigurations before publish.