Skip to content

feat: implement bridge-ui React hooks (Feature 8) - #4

Merged
priosshrsth merged 2 commits into
mainfrom
feature/bridge-ui-hooks
Mar 1, 2026
Merged

feat: implement bridge-ui React hooks (Feature 8)#4
priosshrsth merged 2 commits into
mainfrom
feature/bridge-ui-hooks

Conversation

@priosshrsth

@priosshrsth priosshrsth commented Mar 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add usePrimaryCta, useSecondaryCta, and useActionsMenu React hooks under src/bridge-ui/ that wrap sendToParent() into a declarative API for iframe-embedded Assembly apps
  • Entry point renamed from assembly-kit/react to assembly-kit/bridge-ui across all config and docs
  • Add react >= 18 as optional peer dependency, react + @types/react as dev dependencies
  • Validate inbound postMessage origin against DASHBOARD_DOMAINS or portalUrl to prevent cross-frame injection
  • Extract ensureHttps and add isAllowedOrigin as shared app-bridge utilities
  • Disable oxc/no-barrel-file globally instead of per-file overrides
  • Update README with usage examples for schemas, app-bridge, and bridge-ui hooks

Test plan

  • bun run type-check passes
  • bun run lint passes (0 errors)
  • bun run build succeeds — produces dist/bridge-ui/index.js + dist/bridge-ui/index.d.ts
  • bun test — 127 tests pass, 0 failures
  • Manual: verify import from assembly-kit/bridge-ui resolves in a consuming project

🤖 Generated with Claude Code

priosshrsth and others added 2 commits March 1, 2026 13:22
Add usePrimaryCta, useSecondaryCta, and useActionsMenu React hooks
that wrap the app-bridge sendToParent() into a declarative API for
apps embedded in the Assembly dashboard iframe. Entry point renamed
from assembly-kit/react to assembly-kit/bridge-ui. Updated all docs,
config, and README with schemas/app-bridge/bridge-ui usage examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add isAllowedOrigin helper that checks event.origin against
DASHBOARD_DOMAINS or the provided portalUrl. Extract ensureHttps
into a shared module for reuse. Destructure opts into primitives
to avoid stale closure issues in useEffect dependencies. Clarify
useActionsMenu JSDoc that onClick is a dashboard-handled string
identifier, not a local callback. Disable oxc/no-barrel-file
globally instead of per-file overrides.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@priosshrsth
priosshrsth merged commit 8b6ca34 into main Mar 1, 2026
7 checks passed
@priosshrsth
priosshrsth deleted the feature/bridge-ui-hooks branch March 1, 2026 13:36
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