-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathenv.mjs
35 lines (32 loc) · 1.13 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
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
NODE_ENV: z.enum(["development", "test", "production"]),
API_KEY: z.string(),
ALCHEMY_API_URL: z.string().url(),
ALCHEMY_RPC_URL: z.string().url(),
ROOT_ORG_ID: z.string().default("3121a8a0-c548-4d14-a313-630c3b739858"),
},
/**
* Specify your client-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars. To expose them to the client, prefix them with
* `NEXT_PUBLIC_`.
*/
client: {},
/**
* You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
* middlewares) or client-side so we need to destruct manually.
*/
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
API_KEY: process.env.API_KEY,
ALCHEMY_API_URL: process.env.ALCHEMY_API_URL,
ALCHEMY_RPC_URL: process.env.ALCHEMY_RPC_URL,
ROOT_ORG_ID: process.env.ROOT_ORG_ID,
},
});