Mobile (Expo)
Any base service can include an Expo / React Native app. It's opt-in — enable it per
service in the wizard or with --mobile on
stackr add service. The mobile app talks only to its
service's backend; the BetterAuth client manages session cookies, and for token-based
native flows the backend's
flexible middleware accepts an
x-device-session-token header.
App structure
The Expo app uses Expo Router for navigation, Zustand for state, and Axios
for HTTP through a single shared api instance. The harness ships mobile conventions and
(for Claude Code) a stackr-mobile skill covering them:
- Use theme tokens, never hardcoded colors — enforced by
mobile-no-hardcoded-color. - No direct
fetch()in components — go through the sharedapiinstance; enforced bymobile-no-direct-fetch. - Set
useNativeDriveron animations — enforced bymobile-animated-native-driver. - Store tokens in
SecureStore, notAsyncStorage.
Mobile rules gate at lint, not at edit-time
The PostToolUse hook lints backend code only — it no-ops on mobile edits. The three
mobile ast-grep rules above run at npm run lint:sg and in
CI. See Enforcement.
Onboarding & paywall
Two ready-made flows ship with the mobile template:
- Onboarding — a multi-screen intro flow (with a skip option) under
app/(onboarding), using a generatedOnboardingLayout. - Paywall — a
paywall.tsxscreen andPaywallLayout, typically shown after onboarding. The paywall is backed by RevenueCat, so enable that integration if you use it.
Integrations
Each integration ships as a service module plus a Zustand store, initialized in the app
and configured through app.json / environment values. They're optional and independent.
| Integration | What it does |
|---|---|
| RevenueCat | In-app purchases and subscriptions; backs the paywall (per-platform API keys) |
| Adjust | Mobile attribution & analytics; sandbox or production environment |
| Scate | Media-buying optimization & engagement (single API key) |
| ATT | App Tracking Transparency — the iOS 14.5+ tracking prompt |
ATT and Adjust
When Adjust is enabled, App Tracking Transparency is wired in so the tracking prompt is requested before attribution initializes. The ATT state is exposed through a store your screens can read.
Configure each provider's keys per its dashboard, then fill the corresponding values in your app config before building. Refer to each provider's own documentation — RevenueCat, Adjust, and Scate — for obtaining credentials.
Building & shipping
Mobile apps build and submit with EAS. See Deployment for the build and submit commands.