Openstatus www.openstatus.dev
at 4c0f4c00a38753a5d0dfd7e7b7b7706dec6f1503 43 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 AXIOM_TOKEN: z.string(), 20 AXIOM_DATASET: z.string(), 21 }, 22 23 /** 24 * What object holds the environment variables at runtime. This is usually 25 * `process.env` or `import.meta.env`. 26 */ 27 runtimeEnv: process.env, 28 29 /** 30 * By default, this library will feed the environment variables directly to 31 * the Zod validator. 32 * 33 * This means that if you have an empty string for a value that is supposed 34 * to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag 35 * it as a type mismatch violation. Additionally, if you have an empty string 36 * for a value that is supposed to be a string with a default value (e.g. 37 * `DOMAIN=` in an ".env" file), the default value will never be applied. 38 * 39 * In order to solve these issues, we recommend that all new projects 40 * explicitly specify this option as true. 41 */ 42 skipValidation: true, 43});