Thanh / Digital garden

← All notes

From the notebook

Safely Read Env Variables

javascript / valibot

import { object, parse, string } from 'valibot'
export const env = parse(
object({
NODE_ENV: string(),
DATABASE_URL: string(),
RESEND_API_KEY: string(),
}),
process.env,
)