Typesafe Envs made Simple

This is the framework agnostic core package of t3-env.
For full documentation, see https://env.t3.gg
Installation
npm i @t3-oss/env-core
pnpm add @t3-oss/env-core
bun add @t3-oss/env-core
deno add jsr:@t3-oss/env-core
Usage
[!NOTE]
You may use any Standard Schema compliant validator of your choice. This example uses Zod.
See the documentation for more details.
import { createEnv } from "@t3-oss/env-core";
import * as z from "zod";
export const env = createEnv({
server: {
DATABASE_URL: z.url(),
OPEN_AI_API_KEY: z.string().min(1),
},
clientPrefix: 'PUBLIC_',
client: {
PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
},
runtimeEnv: process.env,
});