![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
react-native-secure-key-store
Advanced tools
React Native Library for securely storing keys to iOS and Android devices in KeyChain and KeyStore respectively.
React Native Library for securely storing keys to iOS and Android devices in KeyChain and KeyStore respectively
$ npm install react-native-secure-key-store --save
or
$ yarn add react-native-secure-key-store
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-secure-key-store
and add RNSecureKeyStore.xcodeproj
libRNSecureKeyStore.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainApplication.java
import com.reactlibrary.securekeystore.RNSecureKeyStorePackage;
to the imports at the top of the filenew RNSecureKeyStorePackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-secure-key-store'
project(':react-native-secure-key-store').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-secure-key-store/android')
android/app/build.gradle
:
compile project(':react-native-secure-key-store')
import RNSecureKeyStore, {ACCESSIBLE} from "react-native-secure-key-store";
// For storing key
RNSecureKeyStore.set("key1", "value1", {accessible: ACCESSIBLE.ALWAYS_THIS_DEVICE_ONLY})
.then((res) => {
console.log(res);
}, (err) => {
console.log(err);
});
// For retrieving key
RNSecureKeyStore.get("key1")
.then((res) => {
console.log(res);
}, (err) => {
console.log(err);
});
// For removing key
RNSecureKeyStore.remove("key1")
.then((res) => {
console.log(res);
}, (err) => {
console.log(err);
});
Key | Platform | Description | Default |
---|---|---|---|
accessible | iOS only | This dictates when a keychain item is accessible, see possible values in Keychain.ACCESSIBLE . | Keychain.ACCESSIBLE.WHEN_UNLOCKED |
Keychain.ACCESSIBLE
enumKey | Description |
---|---|
WHEN_UNLOCKED | The data in the keychain item can be accessed only while the device is unlocked by the user. |
AFTER_FIRST_UNLOCK | The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. |
ALWAYS | The data in the keychain item can always be accessed regardless of whether the device is locked. |
WHEN_PASSCODE_SET_THIS_DEVICE_ONLY | The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device. Items with this attribute never migrate to a new device. |
WHEN_UNLOCKED_THIS_DEVICE_ONLY | The data in the keychain item can be accessed only while the device is unlocked by the user. Items with this attribute do not migrate to a new device. |
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY | The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. Items with this attribute never migrate to a new device. |
ALWAYS_THIS_DEVICE_ONLY | The data in the keychain item can always be accessed regardless of whether the device is locked. Items with this attribute never migrate to a new device. |
By default, this library resets the device's Keychain when it detects the app has been uninstalled.
If you don't want this to occur, you can disable this behavior at any given time by doing:
RNSecureKeyStore.setResetOnAppUninstallTo(false)
For Testing using Jest, add RNSecureKeyStoreMock implementation under your test/mocks folder. This mock implementation makes easy for you to make testing that dependes on react-native-secure-key-store
ISC License (ISC) Copyright (c) 2016 pradeep singh
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FAQs
React Native Library for securely storing keys to iOS and Android devices in KeyChain and KeyStore respectively.
We found that react-native-secure-key-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.