Skip to content

Farcaster support#24

Merged
bobo-k2 merged 7 commits intomasterfrom
iframe-communication
Mar 13, 2026
Merged

Farcaster support#24
bobo-k2 merged 7 commits intomasterfrom
iframe-communication

Conversation

@bobo-k2
Copy link
Copy Markdown
Collaborator

@bobo-k2 bobo-k2 commented Mar 3, 2026

Summary

Create another route for communication with dApps hosted inside Startale app. For those dApps no popup window will be displayed

Main reason is for doing this is to avoid adding complex code to Startale app which includes adding reference Google comlink and some hardly traceable and understandable logic as implemented here https://github.com/StartaleGroup/superapp/tree/miniapp-poc

I needed to rethink the whole concept because I finally understood how Farcaster host for mini apps works and because on some requirements from the PM.

The requirements are

  • we would like mini app devs to use our SDK
  • we would also like to include mini apps not using our SDK

Farcaster injects EIP 1193 provider to iframe, so a hosted mini app can use it. Which means mini app devs can use injected provider with Farcaster connector. If we want them to use our SDK we need to support Farcaster in our SDK.

The approach I initially created forced devs to use SDK for their mini apps.

How did you test your changes?

Hoseted a miniapp using the current SDK inside Strtale app.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an iframe-based communication path for dApps embedded inside the Startale app, avoiding popup-based flows by introducing an ICommunicator abstraction and an IframeCommunicator implementation.

Changes:

  • Introduces ICommunicator and updates existing popup Communicator / Signer / BaseAccountProvider to depend on the interface.
  • Adds iframe detection (shouldUseIframeMode) and wires createStartaleAccountSDK to use IframeCommunicator when embedded.
  • Adds/updates tests for iframe mode and exports the new communicator types from the SDK entrypoint.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/app-sdk/src/sign/app-sdk/Signer.ts Switches communicator dependency from concrete Communicator to ICommunicator.
packages/app-sdk/src/interface/builder/core/createStartaleAccountSDK.ts Chooses iframe mode via shouldUseIframeMode; constructs IframeCommunicator + passes into provider.
packages/app-sdk/src/interface/builder/core/createStartaleAccountSDK.test.ts Adds test coverage for iframe-mode provider creation and COOP check behavior.
packages/app-sdk/src/interface/builder/core/BaseAccountProvider.ts Allows injecting an ICommunicator (iframe or popup) into the provider.
packages/app-sdk/src/index.ts Exposes ICommunicator type and IframeCommunicator export.
packages/app-sdk/src/core/error/serialize.ts Changes serialized error docUrl to an empty string.
packages/app-sdk/src/core/communicator/iframeUtils.ts Adds iframe detection + allowed-origin logic.
packages/app-sdk/src/core/communicator/IframeCommunicator.ts Adds iframe postMessage-based communicator and handshake logic.
packages/app-sdk/src/core/communicator/IframeCommunicator.test.ts Adds tests for iframe communicator behavior (constructor/onMessage/handshake/etc).
packages/app-sdk/src/core/communicator/ICommunicator.ts Defines the shared communicator interface.
packages/app-sdk/src/core/communicator/Communicator.ts Implements ICommunicator for the existing popup-based communicator.
packages/app-sdk/package.json Bumps SDK version to 1.3.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/app-sdk/src/core/communicator/IframeCommunicator.ts Outdated
Comment thread packages/app-sdk/src/core/error/serialize.ts
Comment thread packages/app-sdk/src/core/communicator/IframeCommunicator.test.ts Outdated
Comment thread packages/app-sdk/src/core/communicator/IframeCommunicator.test.ts Outdated
@bobo-k2 bobo-k2 requested review from JGJP and codespool March 3, 2026 14:44
Comment thread packages/app-sdk/src/core/communicator/IframeCommunicator.ts Outdated
Comment thread packages/app-sdk/src/core/error/serialize.ts
@bobo-k2 bobo-k2 marked this pull request as draft March 5, 2026 08:35
@bobo-k2 bobo-k2 changed the title IFrame communication support Farcaster support Mar 5, 2026
@bobo-k2 bobo-k2 marked this pull request as ready for review March 5, 2026 09:00
@bobo-k2 bobo-k2 requested review from JGJP and cmhchoi March 5, 2026 09:00
Comment thread packages/app-sdk/src/core/communicator/FarcasterProvider.ts Outdated
Comment thread packages/app-sdk/src/core/communicator/FarcasterProvider.ts Outdated
Comment thread packages/app-sdk/src/core/communicator/FarcasterProvider.ts Outdated
Comment thread packages/app-sdk/src/core/communicator/FarcasterProvider.ts Outdated
Comment thread packages/app-sdk/src/core/communicator/iframeUtils.ts
Comment thread packages/app-sdk/src/interface/builder/core/createStartaleAccountSDK.ts Outdated
@bobo-k2 bobo-k2 requested a review from JGJP March 13, 2026 09:32
@bobo-k2 bobo-k2 merged commit 7572e9b into master Mar 13, 2026
7 checks passed
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.

3 participants