Installing tKey JS SDK
The tKey SDK contains multiple packages are needed to enable different functionalities of the tKey SDK. You can choose the packages you want to install according to the functionalities you want to enable in your application. In this doc we have highlighted all of the packages and their functionalities.
Base tKey Package
While installing Web3Auth Core Kit tKey SDK, we recommend installing the tkey/core
SDK. This
package contains all the needed core functionalities of the tkey
SDK.
@tkey/core
- npm
- Yarn
- pnpm
npm install --save @tkey/core
yarn add @tkey/core
pnpm add @tkey/core
Adding Service Provider
The Service Provider helps with the authentication and identification of the user using their social logins and giving the user an easy way of account retrieval. We have made a custom service provider utilizing the Single Factor Auth JS SDK as a service provider within the tKey SDK.
@tkey/service-provider-sfa
- npm
- Yarn
- pnpm
npm install --save @tkey/service-provider-sfa
yarn add @tkey/service-provider-sfa
pnpm add @tkey/service-provider-sfa
Adding Storage Layer
The Storage Layer refers to the Metadata Storage, which is used to store the metadata information of the shares generated by the tKey SDK.
@tkey/storage-layer-torus
- npm
- Yarn
- pnpm
npm install --save @tkey/storage-layer-torus
yarn add @tkey/storage-layer-torus
pnpm add @tkey/storage-layer-torus
Modules
Modules extend the tKey SDK's capability to provide additional functionality for managing your tKey shares. Out of the multiple modules available, you can choose the module you want to include in your implementation. Here is the list of available modules:
Storage Modules (Share B)
Storage Modules are used to store the tKey shares in the user's device storage. You can choose any of the following modules:
Web Storage Module
Adds the capability to add or remove a share from the local and file storage.
@tkey/web-storage
- npm
- Yarn
- pnpm
npm install --save @tkey/web-storage
yarn add @tkey/web-storage
pnpm add @tkey/web-storage
React Native Storage Module
Adds the capability to add or remove a share from the React Native Encrypted Store/ Expo Secure Store.
@tkey/react-native-storage
- npm
- Yarn
- pnpm
npm install --save @tkey/react-native-storage
yarn add @tkey/react-native-storage
pnpm add @tkey/react-native-storage
Chrome Storage Module
Adds the capability to add or remove a share from the Chrome Extension storage.
@tkey/chrome-storage
- npm
- Yarn
- pnpm
npm install --save @tkey/chrome-storage
yarn add @tkey/chrome-storage
pnpm add @tkey/chrome-storage
Recovery Modules (Share C)
Recovery Modules are used to recover the tKey shares in the case user doesn't have access to their device/storage or needs additional security.
Security Questions Module
Adds the capability to add or remove a question and password as a share.
@tkey/security-questions
- npm
- Yarn
- pnpm
npm install --save @tkey/security-questions
yarn add @tkey/security-questions
pnpm add @tkey/security-questions
Share Transfer Module
Adds the capability to transfer a share to another device.
@tkey/share-transfer
- npm
- Yarn
- pnpm
npm install --save @tkey/share-transfer
yarn add @tkey/share-transfer
pnpm add @tkey/share-transfer
Share Serialization Module
Adds the capability to serialize/ deserialize a BN (private key) into a mnemonic.
@tkey/share-serialization
- npm
- Yarn
- pnpm
npm install --save @tkey/share-serialization
yarn add @tkey/share-serialization
pnpm add @tkey/share-serialization
Additional Modules
These modules provide extra capability to the tKey SDK, like importing users' existing private keys or seedphrases.
Seed Phrase Module
Adds the capability to store and use seed phrases on the metadata.
@tkey/seed-phrase
- npm
- Yarn
- pnpm
npm install --save @tkey/seed-phrase
yarn add @tkey/seed-phrase
pnpm add @tkey/seed-phrase
Private Keys Module
Adds the capability to store extra private keys on the metadata.
@tkey/private-keys
- npm
- Yarn
- pnpm
npm install --save @tkey/private-keys
yarn add @tkey/private-keys
pnpm add @tkey/private-keys
Troubleshooting
Bundler Issues: Missing Dependencies
You might face issues mentioning that certain dependencies are missing within the browser or React Native environments. These are node dependencies that need to be polyfilled in your application, to enable Web3Auth functionalities. Furthermore, your bundler needs to be reconfigured to use them while building the app. We have created guides for different bundlers to help you with this issue:
- Please check out our Webpack 5 Troubleshooting Guide
- Please check out our Vite Troubleshooting Guide
- Please check out our React Native Troubleshooting Guide