-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.ts
34 lines (33 loc) · 1.08 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
/* eslint-disable no-process-env */
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';
export const env = createEnv({
server: {
POSTGRES_PRISMA_URL: z.string(),
POSTGRES_URL_NON_POOLING: z.string(),
KV_REST_API_TOKEN: z.string(),
KV_REST_API_READ_ONLY_TOKEN: z.string(),
KV_REST_API_URL: z.string().url(),
KV_URL: z.string().url(),
},
client: {},
shared: {
NODE_ENV: z
.enum(['development', 'test', 'production'])
.default('development'),
},
runtimeEnv: {
POSTGRES_PRISMA_URL: process.env.POSTGRES_PRISMA_URL,
POSTGRES_URL_NON_POOLING: process.env.POSTGRES_URL_NON_POOLING,
NODE_ENV: process.env.NODE_ENV,
KV_REST_API_TOKEN: process.env.KV_REST_API_TOKEN,
KV_REST_API_READ_ONLY_TOKEN: process.env.KV_REST_API_READ_ONLY_TOKEN,
KV_REST_API_URL: process.env.KV_REST_API_URL,
KV_URL: process.env.KV_URL,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
* useful for Docker builds.
*/
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
});