Openstatus www.openstatus.dev
at dbacbdafdd0774ade06f0d5825a967950aa1436a 41 lines 1.5 kB view raw
1import { monitorRegions } from "@openstatus/db/src/schema/constants"; 2import { createEnv } from "@t3-oss/env-core"; 3import { z } from "zod"; 4 5export const env = createEnv({ 6 server: { 7 UNKEY_API_ID: z.string().min(1), 8 UNKEY_TOKEN: z.string().min(1), 9 TINY_BIRD_API_KEY: z.string().min(1), 10 UPSTASH_REDIS_REST_URL: z.string().min(1), 11 UPSTASH_REDIS_REST_TOKEN: z.string().min(1), 12 FLY_REGION: z.enum(monitorRegions), 13 CRON_SECRET: z.string(), 14 SCREENSHOT_SERVICE_URL: z.string(), 15 QSTASH_TOKEN: z.string(), 16 NODE_ENV: z.string().prefault("development"), 17 SUPER_ADMIN_TOKEN: z.string(), 18 RESEND_API_KEY: z.string(), 19 }, 20 21 /** 22 * What object holds the environment variables at runtime. This is usually 23 * `process.env` or `import.meta.env`. 24 */ 25 runtimeEnv: process.env, 26 27 /** 28 * By default, this library will feed the environment variables directly to 29 * the Zod validator. 30 * 31 * This means that if you have an empty string for a value that is supposed 32 * to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag 33 * it as a type mismatch violation. Additionally, if you have an empty string 34 * for a value that is supposed to be a string with a default value (e.g. 35 * `DOMAIN=` in an ".env" file), the default value will never be applied. 36 * 37 * In order to solve these issues, we recommend that all new projects 38 * explicitly specify this option as true. 39 */ 40 skipValidation: true, 41});