import type { NextConfig } from "next"; const nextConfig: NextConfig = { // The SDKs ship ESM; let Next transpile them. transpilePackages: ["@abe-kap/appshell-sdk", "@insignia/iios-messaging-ui"], // The browser calls the Shell BFF same-origin under /shell (so the HttpOnly // session cookie flows). We deliberately use /shell (NOT /api) to avoid // clobbering the existing /api/geo route. Point BFF_ORIGIN at the deployed BFF. async rewrites() { const bff = process.env.BFF_ORIGIN ?? "http://localhost:4000"; return [{ source: "/shell/:path*", destination: `${bff}/api/:path*` }]; }, }; export default nextConfig;