asyncStorage
Creates a Storage adapter backed by @react-native-async-storage/async-storage.
Values are JSON-serialized and stored in plain text. Use it for non-sensitive provider state; when the provider manages access keys, use secureMmkv instead.
The adapter ships as an optional subpath — accounts/react-native/async-storage — so apps that do not use it do not install AsyncStorage:
npx expo install @react-native-async-storage/async-storageUsage
import { } from 'accounts'
import { } from 'accounts/react-native/async-storage'
const = .({
: (),
})Parameters
options.key
- Type:
string - Default:
'tempo'
Key prefix applied to every entry written to AsyncStorage. Useful to avoid collisions with other AsyncStorage usage in the app.
import { } from 'accounts'
import { } from 'accounts/react-native/async-storage'
const = .({
: ({
: 'my-app',
}),
})