Create a React Native project and use Expo SecureStore to store local data in iOS and Android that’s encrypted and secure.

What is AsyncStorage?

You could think of AsyncStorage as local storage for React Native. That’s because it is! As described on React Native’s website: “AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app.”

It’s a mouthful. But simply put, it allows you to save data locally on the user’s device. Say you want to recall a users theme setting or allow them to pick up where they left off after restarting their phone or the app, being able to persist data offline makes AsyncStorage your best friend!

Why you shouldn’t use AsyncStorage for sensitive data

If, on the other hand, you need to store sensitive data — i.e., a JWT token — AsyncStorage is that best friend who always gets you in trouble. Remember, the data that you save with AsyncStorage is unencrypted, so anyone with access can read it, which isn’t good for sensitive data.

Encrypted data storage alternatives

For sensitive information, we need an encrypted and secure way of storing data locally. Luckily, we have options:

All three of these are great options to use, but in this article, we’re going to cover Expo SecureStore.

Expo is a wonderful SDK with several fabulous libraries, although you need to configure unimodules to use Expo with a Bare React App. But once it’s done, the world is your oyster.

Creating a React Native project

If you would like to have a look the final code, you can find it on my GitHub:

#react-native #mobile-apps #programming #developer

React Native and Expo SecureStore: Encrypt Local Data
10.05 GEEK