@t3-oss/env-nuxt

212,701 4,017
Install
npm install @t3-oss/env-nuxt
Latest Version:0.13.11
License:MIT
Last Updated:Apr 1, 2026
Links: GitHub  ·  npm
Maintainer: nexxel

Typesafe Envs made Simple

NPM Version JSR JSR Score Socket Badge

The Nuxt package comes preconfigured for Nuxt, and fills the runtimeEnv option automatically. All you need to do is define your schemas!

For full documentation, see https://env.t3.gg

Installation

# npm
npm i @t3-oss/env-nuxt

# pnpm
pnpm add @t3-oss/env-nuxt

# bun
bun add @t3-oss/env-nuxt

# deno
deno add jsr:@t3-oss/env-nuxt

Usage

[!NOTE]

You may use any Standard Schema compliant validator of your choice. This example uses Zod

// src/env.ts
import { createEnv } from "@t3-oss/env-nuxt";
import * as z from "zod";

export const env = createEnv({
  /*
   * Serverside Environment variables, not available on the client.
   * Will throw if you access these variables on the client.
   */
  server: {
    DATABASE_URL: z.url(),
    OPEN_AI_API_KEY: z.string().min(1),
  },
  /*
   * Environment variables available on the client (and server).
   *
   * 💡 You'll get type errors if these are not prefixed with NUXT_PUBLIC_.
   */
  client: {
    NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
  },
});

Related Packages

@norbiros/nuxt-auto-form

Auto-generate Nuxt UI forms from Zod 4 schemas

9,137 58
nuxt-precognition

Nuxt module implementing Precognition protocol (inspired by official Laravel Pre...

3,621 18
@scayle/storefront-nuxt

Nuxt integration for the SCAYLE Commerce Engine and Storefront API

152,903
nuxt-tsconfig-stub

Stub Nuxt's generated tsconfig.json at installation

70,835 24
@sidebase/nuxt-parse

Parse, validate and transform data with confidence in nuxt using `zod`

12,669 54

Version History

Version Released License
0.13.11 MIT
0.13.10 MIT
0.13.9 MIT
0.13.8 MIT
0.13.7 MIT
Pre-releases (10)
Version Released License
0.13.4-canary.2c99b41 MIT
0.13.1-canary.c99c35e MIT
0.13.1-canary.f66e736 MIT
0.13.1-canary.95978c4 MIT
0.13.1-canary.a5b80a2 MIT