DEV Community

Agung Jaya
Agung Jaya

Posted on

react-native-journey-recovery — Never Make Users Start Over Again

Never Make Your Users Start Over Again 🙅‍♂️

Ever had a user fill out a 5-step form... then the app crashes. They open it again. Everything's gone. 😭

react-native-journey-recovery fixes that.

It automatically saves and restores multi-step flows — even if the app is killed, crashes, or the user leaves mid-way.

What you get

  • Works with AsyncStorage, MMKV, Expo SecureStore, or your own custom adapter
  • Checksummed snapshots — corrupted data is reported, never silently restored
  • Expiry support (sliding or absolute), set per app, journey, or checkpoint
  • Schema migration — bump a version and add migrate() to upgrade old checkpoints
  • Field exclusion — drop secrets before anything is written to storage
  • Zero native code — works on Expo Go too
  • React Hook Form integration via useJourneyForm

Quick Start

npm install react-native-journey-recovery
Enter fullscreen mode Exit fullscreen mode
// 1. Wrap your app
<RecoveryProvider>
  <App />
</RecoveryProvider>

// 2. Save checkpoints in your multi-step flow
const { save } = useJourney('onboarding');
await save('step-2', { name, email });

// 3. Offer to resume
const { resume, checkpoint } = useRecovery('onboarding');
if (checkpoint) {
  // ask user if they want to continue where they left off
}

// 4. Clear when done
await clear();
Enter fullscreen mode Exit fullscreen mode

Security

  • Exclude secrets with field exclusion before writing to storage
  • Use encrypted storage backends (Expo SecureStore, MMKV encrypted) for data at rest
  • Built-in FNV-1a checksum catches accidental corruption
  • Optional transform hook for encryption or HMAC signing

Links

Give it a star if it saves your users from starting over! ⭐

Top comments (0)