Federation vs. iframe
whisker-host implements both integration paths simultaneously. A single
deployment can host a mix of federation modules and iframe consumers, and a
single module team can move between them by changing one field in their
manifest.
| Federation module | Iframe consumer | |
|---|---|---|
| Use when | Greenfield, or rewrite | You already have a working app and just want it inside the host |
| Built with | Vite + Module Federation | Whatever you already use (React, Angular, anything) |
| Talks to host via | Direct ESM imports from remoteSafeSelectors.ts (useAuth, authService, useInEditMode, useIsNavOpen) |
postMessage (T.R.U.E-compatible protocol) |
| Routing | Inside host’s BrowserRouter — useParams, useNavigate, Link all work natively |
Owns its own router; host mounts a catch-all route |
| Auth token acquired | useAuth().accessToken |
requestAccessToken message → host responds with accessToken |
| Style/theme | Imports Nike theme from the component library | Owns its own |
| Best for new code | Yes | Last resort; convert when you can |
Scaffolding each path
Section titled “Scaffolding each path”# Federation module (greenfield)thundercats create module my-module
# Convert an existing app to an iframe consumerthundercats add iframe-consumerRuntime flow
Section titled “Runtime flow”Both module types share one registry and one auth flow. The only difference
is the rendering primitive (federated component vs <iframe>). See
WhiskerPlatform Architecture for the
full sequence diagram, from manifest fetch through token exchange.
See Architecture → Host ↔ module contract for the full mechanism, and Architecture → Consumer integration guide for onboarding an external team end to end.
