r/reactnative • • 18d ago

Article Open-source: add a retro mini-game arcade to your React Native app with one component (MIT)

I've open-sourced Open Arcade, a set of six canvas mini-games in a handheld-console UI. It comes with u/open-arcade/react-native, a WebView host that talks to the page over a small typed bridge.

<OpenArcadeView
  source={{ uri: 'https://your-host/open-arcade/' }}
  initData={{ userId, topInset: insets.top, bottomInset: insets.bottom }}
  config={{ rewardsEnabled: true, coupons: rewardsFromYourBackend }}
  onClose={() => navigation.goBack()}
  onGameEvent={(e) => track(e.kind, e.game, e.score)}
/>
  • Versioned JSON bridge (ready, close, openUrl, share, event), documented in docs/protocol.md
  • The host injects config before page load, so real reward codes never ship in the web bundle
  • Safe-URL checks for navigation, plus Android back handling, loader and retry
  • An Expo example app that opens straight into the arcade

Demo: https://open-arcade-kohl.vercel.app Repo: https://github.com/viswasekaran/open-arcade

1 Upvotes

2 comments sorted by

0

u/[deleted] 18d ago

[removed] — view removed comment

1

u/Competitive-Edge6478 18d ago

Good catch, you’re right. Config is readable in the WebView, so the real codes shouldn’t go in at load. I’ll change it to pass reward ids only and have the host claim the code from the backend after a win, with a server-side sanity check on score and time. Thanks!