feat: SDK window-bridge shared services + login fix + FuzeClock example - #9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 andgetCurrentUserunwraps 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.usePlatform()<Toaster/>regionuseToast()menu.add/remove→ reducer → SidePanel renders app itemsgetBridge().menugetBridge().socketgetBridge()/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-reactso appsnpm installit instead of vendoring; migrate the remaining provider-based SDK hooks fully onto the bridge; notifications backend behindnotify()for persistence/fan-out.