fetch, but a mobile bundle cannot safely hold a Praxa
API key or backend OAuth token. Your app calls your authenticated application
backend; that backend validates the user and calls Praxa.
Prerequisites
Before you begin, prepare:- an authenticated application backend that owns the Praxa credential;
- a reviewed mobile session mechanism and an app-facing bounded API contract;
- a simulator or emulator plus at least one physical-device test plan;
- synthetic data and a persisted local request identifier for lifecycle recovery;
- an acceptance assertion that proves the app never receives a Praxa key and recovers the same request after backgrounding.
1. Define the app contract
Your backend should expose a product-specific route such as:2. Implement the mobile client
src/api/praxa.ts
applicationToken belongs to your app, not Praxa. Store user-session material
with your reviewed secure-storage approach, not Async Storage.
3. Preserve the logical request across retries
Create and persistrequestId when the user commits the action. Reuse it while
that exact task is unresolved:
newApplicationRequestId() with the secure UUID facility or reviewed
UUID library already used by your app; do not derive it from timestamps or
user identifiers.
If the user edits the task after a failed attempt, create a new request ID.
4. Design reachable states
5. Test the app
With Jest, React Native Testing Library, or your network mock:- Assert the app calls only your application origin.
- Assert no
praxa_sk_, Gateway token, or provider key exists in the bundle. - Assert repeated taps do not create a second logical request.
- Assert an ambiguous failure retains the draft and request ID.
- Assert cancellation aborts the local request but does not claim the run was cancelled.
- Assert
401clears or refreshes only the application session. - Test offline, slow,
429, malformed response, and app-background recovery.
Troubleshooting
Best practices
- Keep Praxa credentials and provider clients on the backend.
- Use HTTPS and platform network-security defaults.
- Store only application session material in secure storage.
- Persist unresolved request identity, not full sensitive payloads, when possible.
- Redact task content from crash and analytics products.
- Test physical-device network, background, and resume behavior separately from unit tests.
React Native networking
Review current Fetch behavior and native platform networking constraints.
React Native security
Review why secrets do not belong in app code and how an orchestration layer
protects server API keys.
Optimize for production
- Debounce repeated UI actions while preserving the same logical request ID.
- Return small app-facing projections and paginate history instead of copying upstream payloads.
- Reconcile on foreground with one bounded read rather than restarting the operation.
- Measure device-to-backend latency, resume success, duplicate prevention, payload size, and energy impact.
Cleanup and next steps
- Revoke disposable backend credentials and test application sessions.
- Delete synthetic server records and clear test-only secure-storage entries.
- Remove captured screenshots, logs, and crash reports containing synthetic payloads.
- Record physical-device, background, and recovery checks separately from unit tests.