diff --git a/lib/config.ts b/lib/config.ts index 90d3f915..28e2032c 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -2,7 +2,7 @@ * Centralized configuration management for the application. * This file provides a type-safe way to access environment variables. */ -import { envSchema, getRawEnv } from './env'; +import { env, getRawEnv } from './env'; let memoizedConfig: ReturnType | undefined; @@ -11,7 +11,7 @@ let memoizedConfig: ReturnType | undefined; * Throws if validation fails. */ function createConfig() { - const env = envSchema.parse(getRawEnv()) as any; + const env = getRawEnv(); const target = env.NEXT_PUBLIC_TARGET || env.TARGET; diff --git a/lib/env.ts b/lib/env.ts index ff9bc7e6..3638d5f8 100644 --- a/lib/env.ts +++ b/lib/env.ts @@ -10,9 +10,7 @@ import { validateMintelEnv, mintelEnvSchema } from '@mintel/next-utils'; * - Logging * - Analytics */ -export const envSchema = z.object({ - ...mintelEnvSchema, - +const envExtension = { // Project specific overrides or additions AUTH_COOKIE_NAME: z.string().default('klz_gatekeeper_session'), @@ -29,12 +27,12 @@ export const envSchema = z.object({ INFRA_DIRECTUS_URL: z.string().url().optional(), INFRA_DIRECTUS_TOKEN: z.string().optional(), -}); +}; /** * Validated environment object. */ -export const env = validateMintelEnv(envSchema.shape); +export const env = validateMintelEnv(envExtension); /** * For legacy compatibility with existing code.