[AI-8410] Feature: Host apps can load Angie sidebar with v2 config — host API bridge - #45
Merged
Conversation
matipojo
force-pushed
the
AI-8410-v2-layouts
branch
from
May 31, 2026 07:52
f963665 to
59356d9
Compare
matipojo
force-pushed
the
AI-8410-v2-host-bridge
branch
2 times, most recently
from
May 31, 2026 07:59
3b1085d to
69a8cd6
Compare
matipojo
force-pushed
the
AI-8410-v2-layouts
branch
from
May 31, 2026 08:01
0c720f6 to
db0c562
Compare
matipojo
force-pushed
the
AI-8410-v2-host-bridge
branch
from
May 31, 2026 08:01
69a8cd6 to
eaf358d
Compare
…ar boot process - Added ExternalHeadersCallback type to support dynamic header retrieval. - Integrated initHostApiBridge function to initialize the host API with external headers. - Updated bootSidebar to call initHostApiBridge with the necessary configuration. - Created tests for host API bridge to validate header retrieval and error handling. - Ensured callbacks are preserved in the configuration resolution process.
matipojo
force-pushed
the
AI-8410-v2-host-bridge
branch
from
June 1, 2026 10:10
3e0b05b to
028ff3a
Compare
- Added support for retrieving website and analytics context from the host configuration. - Updated initHostApiBridge to accept host configuration, including website and analytics data. - Implemented new message types for website and analytics context requests. - Enhanced tests to validate the retrieval of website and analytics context from the host. - Introduced localStorage handling for GET and SET operations in the host API bridge.
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
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
Stacked PR 3/3 for AI-8410: Feature: Host apps can load Angie sidebar with v2 config.
Adds the host API bridge and
getExternalHeaderscallback wiring for embedded iframe API calls. Completes the split of the original monolithic branch; diff vsAI-8410-load-sidebar-v2is bridge-only on top of #44.Jira
https://elementor.atlassian.net/browse/AI-8410
Test plan
npm testnpm run lint✨ PR Description
1. Problem & Context
Hosts need bidirectional communication with embedded Angie sidebar to provide external headers, website context, and analytics data. This PR establishes a postMessage-based API bridge enabling the iframe to request host-side information with origin validation.
2. What Changed (Where)
ExternalHeadersCallbacktype andanalyticsfield to HostConfig; wiredgetExternalHeadersthrough CallbacksConfig3. How It Works
Boot initiates bridge with iframe origin and callback reference → iframe sends MessageEvent with transferable port → bridge validates origin → routes to handler (headers/context/storage) → callback executes if provided → response posted back on port. Undefined headers filtered before sending; errors caught and reported as error payloads.
4. Risks
Origin spoofing: Mitigated by explicit origin check against configured iframe origin. Callback exceptions: Wrapped in try-catch with error reporting. localStorage failures: Gracefully degrade in private browsing mode. No cleanup:
bridgeListenerRegisteredprevents duplicate listeners but lacks explicit teardown—acceptable for single-boot lifecycle.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