Customizing session persistence
By default, the Privy Expo SDK makes use of expo-secure-store
package to persist sessions after your app is closed.
Custom storage adapters
If you’d rather persist sessions in a different way, you can easily build an adapter and provide it as an optional prop to the PrivyProvider
component:
Customizing the access policy for expo-secure-store
The default expo-secure-store
adapter setup requires the device to be unlocked at least once before accessing storage, which allows you to perform background operations, but still require the user to be in the loop after a device restart. Your app can customize the storage adapter, although be aware that this can have unexpected effects on Privy authentication state. Only do so if you are fully aware of the implications the changes you make will have.
Create a Custom Storage Adapter that specifies the desired value for keychainAccessible
as a configuration option for each method.