d-sports-engage-native (package name: engage-native) is the native mobile app for D-Sports. It mirrors the core PWA experience on iOS and Android: wallet, shop, leaderboard, locker room, and profile.
Run:bunx expo start or bun run start — then press a for Android or i for iOS, or scan the QR code with Expo Go.
All backend communication flows through a shared API client in lib/api/. The client automatically injects Clerk auth tokens and parses the normalized response envelope used by d-sports-api.
Every API response is unwrapped into a standard ApiResponse<T> shape:
Copy
Ask AI
interface ApiResponse<T> { success: boolean; data?: T; error?: string; code?: string; // machine-readable error code from the backend}
The client detects whether a response uses the { success, data } envelope or a legacy bare JSON body and normalizes both into ApiResponse<T>. On non-2xx responses the client extracts error and code fields from the body when available.
The client includes a cache-first fetching utility (lib/api/cache.ts) backed by MMKV. Each domain has a configured TTL (for example, 2 minutes for leaderboard and quests, 5 minutes for teams). Stale cache entries are served as a fallback when the network request fails.