e70904a219
The messenger tab now renders the shared SDK's <Messenger>, not the bespoke in-CRM implementation. The CRM only supplies transport + theme: - CrmMessagingAdapter implements the SDK's MessagingAdapter over the be-crm data door (crm.messenger.conversation.list/open, history, send, directory); live updates via a 4s poll for now (socket realtime is a follow-up that reuses messenger-socket.tsx). Tenancy/auth stay server-side. - messenger-sdk.tsx wires MessagingProvider + adapter (live = CrmMessagingAdapter, demo = the SDK MockAdapter), themed by mapping --miu-* tokens to the CRM design system. - dashboard renders <MessengerSdk/>; the old messenger.tsx is left in place for rollback and will be deleted once this is proven live. NOTE: the SDK is installed from a local tarball (file:) for verification since it isn't published yet. For deploy: publish @insignia/iios-messaging-ui to the registry and change the dep to a version range. transpilePackages covers ESM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
639 B
TypeScript
16 lines
639 B
TypeScript
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;
|