The tKey React Native Storage Module helps you store and recall key shares in the react-native secure storage. This module is the part of the tKey SDK.
npm install --save @tkey/react-native-storage
import { ReactNativeStorageModule } from "@tkey/react-native-storage";
import EncryptedStorage from "react-native-encrypted-storage";
const reactNativeStorageModule = new ReactNativeStorageModule(EncryptedStorage);
import { ReactNativeStorageModule } from "@tkey/react-native-storage";
import * as SecureStore from "expo-secure-store";
const reactNativeStorageModule = new ReactNativeStorageModule(SecureStore);
const share = await(tKeyInstance.modules.reactNativeStorage as ReactNativeStorageModule).getStoreFromReactNativeStorage();
const generateShareResult = await tKeyInstance.generateNewShare();
const share = await tKeyInstance.outputShareStore(generateShareResult.newShareIndex);
await(tKeyInstance.modules.reactNativeStorage as ReactNativeStorageModule).storeDeviceShare(share);
See the full SDK Reference on the Web3Auth Documentation
- This package requires a peer dependency of
@babel/runtime
- Node 18+