Files
mintel.me/apps/web/lib/env.ts
Marc Mintel 8ba81809b0
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Failing after 1m29s
Build & Deploy / 🏗️ Build (push) Failing after 9m23s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
chore: standardize
2026-02-11 11:05:53 +01:00

42 lines
902 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),
);
/**
* Validated environment object.
*/
export const env = validateMintelEnv(envExtension);
/**
* For legacy compatibility with existing code.
*/
export function getRawEnv() {
return env;
}