API reference › @evolu/react-native
Modules
| Module | Description |
|---|---|
| identicon | EvoluIdenticon, which renders an owner's identicon with react-native-svg, an optional peer that only this entry point needs. |
| web | Expo web is not supported, because Metro can't bundle Evolu's web workers. Importing @evolu/react-native in a web build throws. For the web, use @evolu/react-web with a web bundler such as Vite or Next.js. |
Interfaces
| Interface | Description |
|---|---|
| DeviceSecretStorageUnavailableError | The platform can't read its secure storage yet, such as iOS before the device's first unlock after a restart. Try again later. |
| DeviceSecretUnreadableError | The platform's secure storage holds the app's DeviceSecret but can't read it, on Android when the stored record is too short to hold the encrypted secret, the Keystore lost the key that encrypts it or, as Android 13 and later report, the Keystore's own database entry of that key is corrupted, or the record fails authentication. Evolu never deletes a stored secret on its own, so let the user try again, and only when that fails too offer to start over with forgetDeviceSecret. |
Type Aliases
| Type Alias | Description |
|---|---|
| LoadDeviceSecretError | Why loadDeviceSecret failed. |
Variables
| Variable | Description |
|---|---|
| lockManager | React Native LockManager. |
Functions
| Function | Description |
|---|---|
| createEvoluDeps | Creates Evolu dependencies for React Native, in Expo apps and in React Native apps without Expo alike. |
| createRun | Creates a root Run for React Native. |
| forgetDeviceSecret | Deletes the app's stored DeviceSecret, so the next loadDeviceSecret creates a new one, which opens a new, empty device database. It's the start over after a DeviceSecretUnreadableError, or the lasting UnknownError that loadDeviceSecret describes: offer it only after such an error, only when a retry failed too, and only once the user confirms what's lost. The device database the old secret opened is no longer opened, so its AppOwners come back only from their backups, such as their mnemonics, and an AppOwner restored from its backup reopens its own database with its data on this device. |
| loadDeviceSecret | Loads the app's DeviceSecret from the platform's secure storage, and on the first use creates and stores one, without a prompt. Pass it to createEvoluApp as { type: "DeviceSecret", secret }. |