Fix multi-instance support on same page - #30
Draft
matipojo wants to merge 9 commits into
Draft
Conversation
- Export ModeSwitcherConfig type from SDK and index - Add path validation in openIframe to prevent origin override via absolute URLs or protocol-relative paths - Add tests for modeSwitcher/closeButton widget config forwarding - Add tests for path validation
Return iframe reference and origin from openIframe() so each SDK instance posts widget-config directly to its own iframe instead of broadcasting via the shared postMessageToAngieIframe helper. This prevents config cross-talk when multiple instances coexist.
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
matipojo
marked this pull request as draft
June 18, 2026 08:16
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.
Summary
openIframe()now returns{ iframe, iframeOrigin }so callers can post messages directly to a specific iframe instance.loadSidebar()sendssdk-widget-configdirectly to the instance's iframe viapostMessageinstead of using the sharedpostMessageToAngieIframehelper, preventing config cross-talk when multiple SDK instances coexist on the same page.postMessageToAngieIframeimport fromangie-mcp-sdk.tssince it's no longer needed there.Test plan
postMessageis called on the correct iframe with the correct originopenIframereturnsundefined— widget config is silently skipped✨ PR Description
Purpose: Fix multi-instance support to enable multiple Angie SDK instances on the same page with proper iframe isolation and message routing.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how