-
Notifications
You must be signed in to change notification settings - Fork 4
/
env.ts
41 lines (32 loc) · 1.16 KB
/
env.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
server: {
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
DISCORD_CLIENT_ID: z.string().trim().min(1),
DISCORD_CLIENT_SECRET: z.string().trim().min(1),
GITHUB_CLIENT_ID: z.string().trim().min(1),
GITHUB_CLIENT_SECRET: z.string().trim().min(1),
SQLITE_URL: z.string().trim().min(1),
SQLITE_AUTH_TOKEN: z.string().trim().min(1),
REDIS_URL: z.string().trim().min(1),
},
client: {
NEXT_PUBLIC_APP_URL: z.string().url(),
},
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET,
SQLITE_URL: process.env.SQLITE_URL,
SQLITE_AUTH_TOKEN: process.env.SQLITE_AUTH_TOKEN,
REDIS_URL: process.env.REDIS_URL,
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
},
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
emptyStringAsUndefined: true,
});