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:| Use Case | Example | Why It’s OK |
|---|---|---|
| Theme preferences | "dark" or "light" | No user impact if exposed |
| App settings | { notifications: true } | Non-personal configuration |
| Onboarding state | { hasSeenIntro: true } | No security implications |
| Cache data | Recently viewed items | Improves UX, not sensitive |
| Feature flags | { betaFeatures: true } | Non-sensitive app state |
| Upload queue | Progress tracking metadata | No credentials involved |
When to Use SecureStore 🔒
Use SecureStore for anything that could harm the user if exposed:| Use Case | Example | Why It Needs Protection |
|---|---|---|
| Auth tokens | JWT, session tokens | Enables account access |
| Passwords | User credentials | Direct account compromise |
| API keys | Third-party secrets | Service abuse |
| Payment data | Card numbers, CVV | Financial fraud |
| PII | SSN, passport, DOB | Identity theft |
| Biometric data | Face/fingerprint hashes | Privacy violation |
What Launch Stores Where
| Data | Storage | Why |
|---|---|---|
| Auth tokens | SecureStore ✅ | Sensitive - enables account access |
| Session data | SecureStore ✅ | Sensitive - authentication state |
| Color scheme preference | AsyncStorage | Non-sensitive UI preference |
| Upload queue state | AsyncStorage | Non-sensitive progress tracking |
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:Summary
| Aspect | Launch Default | Status |
|---|---|---|
| Auth token storage | expo-secure-store | ✅ Secure |
| Session management | Better Auth + SecureStore | ✅ Secure |
| User preferences | AsyncStorage | ✅ OK (non-sensitive) |
| Upload progress | AsyncStorage | ✅ OK (non-sensitive) |
| API credentials | Environment variables (server-side) | ✅ Secure |
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.