Home / File/ env.js — ui Source File

env.js — ui Source File

Architecture documentation for env.js, a javascript file in the ui codebase. 2 imports, 0 dependents.

File javascript 2 imports

Entity Profile

Dependency Diagram

graph LR
  f80c2994_f268_be3c_8122_3f302899ed19["env.js"]
  7aa515ef_dcd5_1b3e_e466_ebe7c5eabbb4["env-nextjs"]
  f80c2994_f268_be3c_8122_3f302899ed19 --> 7aa515ef_dcd5_1b3e_e466_ebe7c5eabbb4
  6802ce19_522d_e5fb_e458_8826d9f6952e["zod"]
  f80c2994_f268_be3c_8122_3f302899ed19 --> 6802ce19_522d_e5fb_e458_8826d9f6952e
  style f80c2994_f268_be3c_8122_3f302899ed19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
  /**
   * Specify your server-side environment variables schema here. This way you can ensure the app
   * isn't built with invalid env vars.
   */
  server: {
    NODE_ENV: z.enum(["development", "test", "production"]),
  },

  /**
   * Specify your client-side environment variables schema here. This way you can ensure the app
   * isn't built with invalid env vars. To expose them to the client, prefix them with
   * `NEXT_PUBLIC_`.
   */
  client: {
    // NEXT_PUBLIC_CLIENTVAR: z.string(),
  },

  /**
   * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
   * middlewares) or client-side so we need to destruct manually.
   */
  runtimeEnv: {
    NODE_ENV: process.env.NODE_ENV,
    // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
  },
  /**
   * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
   * useful for Docker builds.
   */
  skipValidation: !!process.env.SKIP_ENV_VALIDATION,
  /**
   * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
   * `SOME_VAR=''` will throw an error.
   */
  emptyStringAsUndefined: true,
});

Dependencies

  • env-nextjs
  • zod

Frequently Asked Questions

What does env.js do?
env.js is a source file in the ui codebase, written in javascript.
What does env.js depend on?
env.js imports 2 module(s): env-nextjs, zod.
Where is env.js in the architecture?
env.js is located at packages/shadcn/test/fixtures/frameworks/t3-app/src/env.js (directory: packages/shadcn/test/fixtures/frameworks/t3-app/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free