Secure by Default
Launch is configured with security best practices out of the box. Hereβs whatβs protected and how.Prerequisites
- Expo SecureStore installed
- Auth client configured
Steps
Authentication & Token Storage
Auth tokens are stored securely using
expo-secure-store- iOS: Tokens are stored in the Keychain (hardware-backed encryption)
- Android: Tokens are stored in the Keystore (hardware-backed encryption)
Choosing the Right Storage
BothAsyncStorage and SecureStore have their place. The key is knowing what data belongs where.
AsyncStorage
Unencrypted key-value storage. Fast and simple, but readable on compromised
devices.
SecureStore
Encrypted via native Keychain/Keystore. Hardware-backed protection for
sensitive data.
When to Use AsyncStorage β
AsyncStorage is perfectly fine for non-sensitive, non-PII data:When to Use SecureStore π
Use SecureStore for anything that could harm the user if exposed:What Launch Stores Where
Quick Decision Guide
Ask yourself: βIf someone read this data, could they harm the user?β- No β AsyncStorage is fine
- Yes β Use SecureStore
Troubleshooting
- Tokens not stored: check SecureStore permissions
- Unexpected logout: verify session persistence and SecureStore availability
Next Steps
Best Practices
Be Mindful About What You Store
Before storing any data locally, consider its sensitivity:Think Before You Store
When adding features that persist data, ask:- Could this data harm the user if exposed? β SecureStore
- Could this data impersonate the user? β SecureStore
- Is this financial or personal information? β SecureStore
- Is this just a preference or app state? β AsyncStorage is fine
Audit Storage Periodically
Search your codebase to review whatβs being stored:What Happens on Jailbroken/Rooted Devices
AsyncStorage Exposure
On a jailbroken iOS device or rooted Android device:SecureStore Protection
SecureStore data is stored in:- iOS: Keychain (encrypted, access-controlled)
- Android: Keystore (hardware-backed encryption)
- Specialized forensic tools
- Device-specific exploits
- Significantly more effort and expertise
SecureStore isnβt impenetrable on jailbroken devices, but it raises the bar
dramatically compared to AsyncStorage.
Additional Mobile Security Measures
Remove Sensitive Console Logs
Before production builds, remove any console.log statements that output sensitive data:Consider Certificate Pinning (High-Security Apps)
For apps handling financial data or highly sensitive information:Consider Jailbreak Detection (Financial Apps)
For banking or payment apps, consider detecting compromised devices:Jailbreak detection can be bypassed by determined attackers. Use it as one
layer in defense-in-depth, not as your only protection.
Quick Security Audit
Run this checklist for your app:1
Search for AsyncStorage
Find all uses:
grep -r "AsyncStorage" apps/mobile/2
Verify no sensitive data
Check each usage stores only non-sensitive data
3
Confirm SecureStore for auth
Verify
lib/auth/client.ts uses storage: SecureStore4
Remove sensitive logs
Search for
console.log with tokens, passwords, or user data5
Check third-party SDKs
Verify payment SDKs (Stripe, RevenueCat) use secure storage
Summary
Launch is secure by default. Authentication tokens and sensitive session
data are stored using
expo-secure-store, which provides hardware-backed
encryption on both iOS and Android.