forked from ohcnetwork/leaderboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.mjs
48 lines (45 loc) · 1.81 KB
/
env.mjs
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
42
43
44
45
46
47
48
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
server: {
GITHUB_PAT: z.string(),
},
client: {
// organization details
NEXT_PUBLIC_ORG_NAME: z.string(),
NEXT_PUBLIC_ORG_INFO: z.string().optional(),
NEXT_PUBLIC_ORG_LOGO: z.string(),
NEXT_PUBLIC_GITHUB_ORG: z.string(),
NEXT_PUBLIC_SLACK_URL: z.string().url(),
NEXT_PUBLIC_ORG_START_DATE: z.string(),
// SEO details
NEXT_PUBLIC_META_TITLE: z.string(),
NEXT_PUBLIC_META_IMG: z.string(),
NEXT_PUBLIC_META_DESCRIPTION: z.string(),
NEXT_PUBLIC_META_URL: z.string(),
// page details
NEXT_PUBLIC_PAGE_TITLE: z.string(),
NEXT_PUBLIC_CONTRIBUTORS_INFO: z.string().optional(),
NEXT_PUBLIC_LEADERBOARD_DEFAULT_ROLES: z.string().optional(),
},
runtimeEnv: {
NEXT_PUBLIC_ORG_NAME: process.env.NEXT_PUBLIC_ORG_NAME,
NEXT_PUBLIC_ORG_INFO: process.env.NEXT_PUBLIC_ORG_INFO,
NEXT_PUBLIC_ORG_LOGO: process.env.NEXT_PUBLIC_ORG_LOGO,
NEXT_PUBLIC_GITHUB_ORG: process.env.NEXT_PUBLIC_GITHUB_ORG,
NEXT_PUBLIC_SLACK_URL: process.env.NEXT_PUBLIC_SLACK_URL,
NEXT_PUBLIC_META_TITLE: process.env.NEXT_PUBLIC_META_TITLE,
NEXT_PUBLIC_META_IMG: process.env.NEXT_PUBLIC_META_IMG,
NEXT_PUBLIC_META_DESCRIPTION: process.env.NEXT_PUBLIC_META_DESCRIPTION,
NEXT_PUBLIC_META_URL: process.env.NEXT_PUBLIC_META_URL,
NEXT_PUBLIC_PAGE_TITLE: process.env.NEXT_PUBLIC_PAGE_TITLE,
NEXT_PUBLIC_CONTRIBUTORS_INFO: process.env.NEXT_PUBLIC_CONTRIBUTORS_INFO,
NEXT_PUBLIC_ORG_START_DATE: process.env.NEXT_PUBLIC_ORG_START_DATE,
NEXT_PUBLIC_LEADERBOARD_DEFAULT_ROLES:
process.env.NEXT_PUBLIC_LEADERBOARD_DEFAULT_ROLES,
GITHUB_PAT:
process.env.NODE_ENV === "development" && !process.env.GITHUB_PAT
? ""
: process.env.GITHUB_PAT,
},
});