Files
mb-grid-solutions.com/lib/env.ts
Marc Mintel 08e16ce754
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 4s
🚀 Build & Deploy / 🧪 QA (push) Failing after 33s
🚀 Build & Deploy / 🚀 Deploy (push) Has been cancelled
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
🚀 Build & Deploy / 🔔 Notify (push) Has been cancelled
🚀 Build & Deploy / 🏗️ Build (push) Has been cancelled
fix: resolve excessive ts type instantiation deep recursion in env variables causing QA failure
2026-05-05 10:27:24 +02:00

44 lines
991 B
TypeScript

import { z } from "zod";
import {
validateMintelEnv,
mintelEnvSchema,
withMintelRefinements,
} from "@mintel/next-utils";
/**
* Environment variable schema.
* Extends the default Mintel environment schema which already includes:
* - Directus (URL, TOKEN, INTERNAL_URL, etc.)
* - Mail (HOST, PORT, etc.)
* - Gotify
* - Logging
* - Analytics
*/
const envExtension = {
// Project specific overrides or additions
AUTH_COOKIE_NAME: z.string().default("mb_gatekeeper_session"),
NEXT_PUBLIC_SENTRY_DSN: z.string().optional(),
SENTRY_DSN: z.string().optional(),
};
/**
* Full schema including Mintel base and refinements
*/
// @ts-ignore
export const envSchema = withMintelRefinements(
(z as any).object(mintelEnvSchema).extend(envExtension) as any,
);
/**
* Validated environment object.
*/
// @ts-ignore
export const env = validateMintelEnv(envExtension) as any;
/**
* For legacy compatibility with existing code.
*/
export function getRawEnv() {
return env;
}