import type { NextConfig } from "next";

const buildVariant =
  process.env.FUNNEL_BUILD_VARIANT ??
  process.env.NEXT_PUBLIC_FUNNEL_BUILD_VARIANT ??
  "frontend";

process.env.FUNNEL_BUILD_VARIANT = buildVariant;
process.env.NEXT_PUBLIC_FUNNEL_BUILD_VARIANT = buildVariant;

const nextConfig: NextConfig = {
  env: {
    FUNNEL_BUILD_VARIANT: buildVariant,
    NEXT_PUBLIC_FUNNEL_BUILD_VARIANT: buildVariant,
    NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
    DEV_LOGGER_SERVER_ENABLED: process.env.DEV_LOGGER_SERVER_ENABLED,
    NEXT_PUBLIC_AUTH_REDIRECT_URL: process.env.NEXT_PUBLIC_AUTH_REDIRECT_URL,
  },
};

export default nextConfig;
