How mmendesas/sdk-bridge works
Project type and purpose
• This is not a monolithic full-stack app but a dual-app “SDK Bridge” solution:
• A React Native mobile application (“mobile/”) that embeds a web store experience via WebView and exposes a native “inapp-sdk.”
• A React web application (“web/”) built with Vite that runs inside the WebView as a “web-sdk” and manages authentication flows via XState.
• Purpose: Demonstrate bidirectional communication between native and web SDKs to simulate purchase and authentication flows.
File structure
• mobile/ directory:
• Native folders (android/, ios/) with MainActivity, AppDelegate, Gradle and Pod configurations
• JavaScript/TypeScript app code (App.tsx, index.js, src/)
• inapp-sdk subfolder (EventHub.ts, SDKWebView.tsx, useEventHub.ts)
• web/ directory:
• Vite config, package.json, tsconfigs
• React code in src/ (App.tsx, screens/, components/, context/PaymentProvider.tsx)
• web-sdk subfolder (EventHub.ts, channel.ts, index.ts)
• paymentMachine.ts (XState state machine)
Extract insights from the README
• Emphasizes two concurrently running projects (“mobile” with npx react-native run-android, “web” with yarn dev)
• Features:
• inapp-sdk ↔ web-sdk communication
• WebView embedding of web-app inside mobile
• State machine via XState controlling expiration timer and purchase flow
• No external backend: flows are simulated entirely in-app.