Skip to content

feat: SDK window-bridge shared services + login fix + FuzeClock example - #9

Merged
izzywdev merged 3 commits into
masterfrom
feat/sdk-bridge-shared-services
Jun 16, 2026
Merged

feat: SDK window-bridge shared services + login fix + FuzeClock example#9
izzywdev merged 3 commits into
masterfrom
feat/sdk-bridge-shared-services

Conversation

@izzywdev

Copy link
Copy Markdown
Owner

Completes the SDK shared-services layer using a window-bridge so runtime-loaded microfrontends can use host services with zero build-time coupling — and fixes browser sign-in.

Login fix

Local login never persisted the JWT to localStorage, so the post-login reload bounced back to the login screen. Now the token is stored on login and getCurrentUser unwraps the { user } envelope.

SDK shared services (window.FUZEFRONT)

The host installs a versioned bridge object; the SDK + apps consume it. Replaces the old one-way __FRONTFUSE_CONTEXT__ data snapshot with a real API across the MF boundary.

Service Host SDK
Live context (user/apps/activeApp) fed from app state, subscribable usePlatform()
Toaster <Toaster/> region useToast()
Menu menu.add/remove → reducer → SidePanel renders app items getBridge().menu
Sockets bus over the host's single connection getBridge().socket

getBridge() / isInPlatform() expose the contract; types are exported for app authors.

Example

FuzeClock (clock-app/, deploy/examples/clock-app.yaml): an independently containerized federated remote that self-registers, reads live host context, and pushes toasts through the bridge — proving the model end to end.

Verified

Login endpoints + token persistence shipped; bridge + toaster present in host bundle; clock-app consumes __FUZEFRONT__; remote serves and is registered.

Follow-ups (not in this PR)

Publish @izzywdev/fuzefront-sdk-react so apps npm install it instead of vendoring; migrate the remaining provider-based SDK hooks fully onto the bridge; notifications backend behind notify() for persistence/fan-out.

AppHub Developer and others added 3 commits June 16, 2026 11:32
Local login never wrote the JWT to localStorage, so the post-login full-page
redirect lost it and bounced back to the login screen. Also unwrap the
{ user } envelope from GET /auth/user.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…kets)

Host installs a versioned API object on window.__FUZEFRONT__ that runtime-loaded
remotes consume via the SDK — replacing the one-way __FRONTFUSE_CONTEXT__ snapshot.
- Host: bridge singleton + Toaster region; live context fed from app state;
  menu.add/remove wired to the reducer + rendered in SidePanel; socket bus over
  the host's single connection
- SDK: bridge.ts contract + getBridge(), useToast(), usePlatform() hooks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Independently containerized federated remote with zero build-time knowledge of
the host beyond the SDK/bridge contract. Self-registers, reads live host context,
and pushes toasts through window.__FUZEFRONT__. deploy/examples/clock-app.yaml
runs it on its own ingress host.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant