feat: add env validation
This commit is contained in:
parent
0742f20372
commit
9b51b32a43
2 changed files with 17 additions and 1 deletions
15
env.mjs
Normal file
15
env.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { createEnv } from "@t3-oss/env-nextjs"
|
||||
import { z } from "zod"
|
||||
|
||||
export const env = createEnv({
|
||||
server: {
|
||||
ANALYZE: z
|
||||
.enum(["true", "false"])
|
||||
.optional()
|
||||
.transform((value) => value === "true"),
|
||||
},
|
||||
client: {},
|
||||
runtimeEnv: {
|
||||
ANALYZE: process.env.ANALYZE,
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue