Files
mb-grid-solutions.com/lib/env.ts
Marc Mintel 9f00828b80
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 2m32s
Build & Deploy / 🏗️ Build (push) Successful in 5m10s
Build & Deploy / 🚀 Deploy (push) Successful in 42s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 4m17s
Build & Deploy / 🔔 Notify (push) Successful in 2s
fix: restore glitchtip nesting and fix type errors
2026-04-09 12:24:33 +02:00

42 lines
940 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
*/
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;
}