Goal
Build Sphere wallet as a single codebase that produces three targets:
- Web app — runs in the browser as a standalone site
- Chrome extension — runs as a browser extension with background service worker
- Mobile app — runs as a native iOS/Android app (via React Native or Capacitor)
All three share the same UI components, hooks, and business logic. Only the platform-specific "glue" layer differs.
Why
Today, the web app and extension already share most of their code but the integration layer between them is fragile and hard to maintain. Adding mobile as a third target would multiply this complexity unless we establish a clean separation between UI and platform.
A unified codebase means:
- Ship features once — every new feature is immediately available on all platforms
- Consistent UX — users get the same wallet experience everywhere
- Less code to maintain — no separate repos or duplicated logic per platform
- Faster onboarding — new developers learn one codebase, not three
How
Introduce an adapter layer — a single interface that describes all wallet operations (balances, transfers, messaging, signing, etc.). Each platform provides its own implementation:
- Web — calls the SDK directly in the browser
- Extension — sends messages to the background service worker where the SDK lives
- Mobile — bridges to a native module or embedded SDK instance
The rest of the app (React components, hooks, screens, navigation) is completely platform-agnostic. It only talks to the adapter interface, never to the SDK or platform APIs directly.
Scope
All changes are within the Sphere app repository. The SDK itself is not modified — it already supports browser and Node.js environments. The adapter layer wraps it for each target platform.
Goal
Build Sphere wallet as a single codebase that produces three targets:
All three share the same UI components, hooks, and business logic. Only the platform-specific "glue" layer differs.
Why
Today, the web app and extension already share most of their code but the integration layer between them is fragile and hard to maintain. Adding mobile as a third target would multiply this complexity unless we establish a clean separation between UI and platform.
A unified codebase means:
How
Introduce an adapter layer — a single interface that describes all wallet operations (balances, transfers, messaging, signing, etc.). Each platform provides its own implementation:
The rest of the app (React components, hooks, screens, navigation) is completely platform-agnostic. It only talks to the adapter interface, never to the SDK or platform APIs directly.
Scope
All changes are within the Sphere app repository. The SDK itself is not modified — it already supports browser and Node.js environments. The adapter layer wraps it for each target platform.