tx-agent-kit
Apps

Mobile App

Expo React Native app consuming the API with component and unit test suites.

Mobile App (apps/mobile)

The mobile application is built with Expo and React Native. It provides the same core functionality as the web app, including authentication, organization management, and invitations, through a native mobile interface.

Architecture

The mobile app follows the same client-only pattern as the web app. It consumes API_BASE_URL from Expo config and communicates exclusively with the API server.

Mobile App -> Axios Client -> API Server (apps/api)

There is no local database or offline-first logic. The app is a thin client that delegates all business logic to the API.

Key Modules

ModulePathPurpose
Environmentlib/env.tsRuntime configuration read from Expo's config system, not from process.env directly
Auth Tokenlib/auth-token.tsSecure token storage using the platform's native secure storage mechanisms
Axios Clientlib/axios.tsPre-configured Axios instance pointing to API_BASE_URL with auth token injection
Client APIlib/client-api.tsTyped API client methods wrapping Axios calls with proper request/response typing
Client Authlib/client-auth.tsAuthentication flow logic: sign-up, sign-in, token refresh, and session management
URL Statelib/url-state.tsNavigation state management adapted for React Navigation rather than browser URLs
Session Storestores/session-store.tsCentralized session state management for the authenticated user context

Optional Sentry Errors

The mobile app supports optional Sentry error reporting via EXPO_PUBLIC_SENTRY_DSN.

  • EXPO_PUBLIC_SENTRY_DSN is read in app.config.js and forwarded to runtime env (lib/env.ts).
  • If the value is blank/unset, Sentry is skipped.
  • Sentry is configured for errors only (tracesSampleRate: 0).

See Sentry (Optional) for complete setup.

Component Test Suites

The mobile app maintains full component test coverage:

ComponentTest File
AuthFormcomponents/AuthForm.test.tsx
CreateOrganizationFormcomponents/CreateOrganizationForm.test.tsx
CreateInvitationFormcomponents/CreateInvitationForm.test.tsx
AcceptInvitationFormcomponents/AcceptInvitationForm.test.tsx
SignOutButtoncomponents/SignOutButton.test.tsx
AuthBootstrapProvidercomponents/AuthBootstrapProvider.test.tsx

Unit Test Suites

Core utility modules have dedicated unit tests:

ModuleCoverage
envEnvironment config resolution
auth-tokenToken storage read/write/clear
axiosClient configuration and interceptors
client-apiAPI method typing and request construction
client-authAuth flow state transitions
url-stateNavigation state serialization
session-storeSession state management

Running Tests

# Run mobile unit tests
pnpm --filter @tx-agent-kit/mobile test

On this page