mirror of
https://github.com/PeterMaquiran/tvone.git
synced 2026-04-22 20:15:51 +00:00
23 lines
792 B
TypeScript
23 lines
792 B
TypeScript
import { loadEnvConfig } from "@next/env";
|
|
|
|
loadEnvConfig(process.cwd());
|
|
|
|
function getRequiredEnv(name: string): string | null | undefined {
|
|
return process.env[name];
|
|
}
|
|
|
|
function getOptionalEnv(name: string): string | undefined {
|
|
const value = process.env[name];
|
|
return value && value.trim().length > 0 ? value : undefined;
|
|
}
|
|
|
|
export const env = {
|
|
APP_URL: getRequiredEnv("APP_URL") as string,
|
|
KEYCLOAK_BASE_URL: getRequiredEnv("KEYCLOAK_BASE_URL") as string,
|
|
KEYCLOAK_REALM: getRequiredEnv("KEYCLOAK_REALM") as string,
|
|
KEYCLOAK_CLIENT_ID: getRequiredEnv("KEYCLOAK_CLIENT_ID") as string,
|
|
KEYCLOAK_CLIENT_SECRET: getRequiredEnv("KEYCLOAK_CLIENT_SECRET") as string,
|
|
API_URL: getRequiredEnv("API_URL") as string,
|
|
COOKIE_DOMAIN: getOptionalEnv("COOKIE_DOMAIN") as string,
|
|
};
|