Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 51s
Build & Deploy / 🏗️ Build (push) Failing after 5m26s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
42 lines
909 B
TypeScript
42 lines
909 B
TypeScript
import { z } from "zod";
|
|
import {
|
|
validateMintelEnv,
|
|
mintelEnvSchema,
|
|
withMintelRefinements,
|
|
} from "@mintel/next-utils";
|
|
|
|
const envExtension = {
|
|
AUTH_COOKIE_NAME: z.string().default("mintel_gatekeeper_session"),
|
|
|
|
// Analytics
|
|
UMAMI_WEBSITE_ID: z.string().optional(),
|
|
NEXT_PUBLIC_UMAMI_WEBSITE_ID: z.string().optional(),
|
|
UMAMI_API_ENDPOINT: z.string().url().optional(),
|
|
|
|
// Features
|
|
SHOW_BLOG: z
|
|
.string()
|
|
.transform((v) => v === "true")
|
|
.default("false"),
|
|
};
|
|
|
|
/**
|
|
* Environment variable schema for the main website.
|
|
* Extends the default Mintel environment schema.
|
|
*/
|
|
export const envSchema = withMintelRefinements(
|
|
z.object(mintelEnvSchema).extend(envExtension) as any,
|
|
);
|
|
|
|
/**
|
|
* Validated environment object.
|
|
*/
|
|
export const env = validateMintelEnv(envExtension);
|
|
|
|
/**
|
|
* For legacy compatibility with existing code.
|
|
*/
|
|
export function getRawEnv() {
|
|
return env;
|
|
}
|