Openstatus www.openstatus.dev
at main 35 lines 1.2 kB view raw
1import { createEnv } from "@t3-oss/env-core"; 2import { z } from "zod"; 3 4export const env = createEnv({ 5 server: { 6 R2_TOKEN: z.string().min(1), 7 R2_URL: z.string().min(1), 8 R2_ACCESS_KEY: z.string().min(1), 9 R2_SECRET_KEY: z.string().min(1), 10 HEADER_TOKEN: z.string().min(1), 11 QSTASH_SIGNING_SECRET: z.string().min(1), 12 QSTASH_NEXT_SIGNING_SECRET: z.string().min(1), 13 }, 14 15 /** 16 * What object holds the environment variables at runtime. This is usually 17 * `process.env` or `import.meta.env`. 18 */ 19 runtimeEnv: process.env, 20 21 /** 22 * By default, this library will feed the environment variables directly to 23 * the Zod validator. 24 * 25 * This means that if you have an empty string for a value that is supposed 26 * to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag 27 * it as a type mismatch violation. Additionally, if you have an empty string 28 * for a value that is supposed to be a string with a default value (e.g. 29 * `DOMAIN=` in an ".env" file), the default value will never be applied. 30 * 31 * In order to solve these issues, we recommend that all new projects 32 * explicitly specify this option as true. 33 */ 34 skipValidation: true, 35});