use client side variable for environment
This commit is contained in:
parent
3064db8df7
commit
2322c320a6
@ -27,6 +27,7 @@ const server = z.object({
|
||||
*/
|
||||
const client = z.object({
|
||||
// NEXT_PUBLIC_CLIENTVAR: z.string().min(1),
|
||||
NEXT_PUBLIC_ENVIRONMENT: z.enum(["development", "test", "production"]),
|
||||
});
|
||||
|
||||
/**
|
||||
@ -41,6 +42,7 @@ const processEnv = {
|
||||
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
|
||||
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
|
||||
JWT_SECRET: process.env.JWT_SECRET,
|
||||
NEXT_PUBLIC_ENVIRONMENT: process.env.NODE_ENV,
|
||||
};
|
||||
|
||||
// Don't touch the part below
|
||||
|
@ -21,7 +21,7 @@ const MyApp: AppType<{ session: Session | null }> = ({
|
||||
content="University of Iowa Center for Auditory Training Resources"
|
||||
/>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
{env.NODE_ENV === "production" ? (
|
||||
{env.NEXT_PUBLIC_ENVIRONMENT === "production" ? (
|
||||
<script
|
||||
defer
|
||||
src="https://analytics.brandonegger.com/script.js"
|
||||
|
Loading…
x
Reference in New Issue
Block a user