Skip to main content

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 install --save @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 Web SDK as a service provider within the tKey SDK.

@tkey/service-provider-sfa

npm install --save @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 install --save @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 install --save @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 install --save @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 install --save @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 install --save @tkey/security-questions

Share Transfer Module

Adds the capability to transfer a share to another device.

@tkey/share-transfer

npm install --save @tkey/share-transfer

Share Serialization Module

Adds the capability to serialize/ deserialize a BN (private key) into a mnemonic.

@tkey/share-serialization

npm install --save @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 install --save @tkey/seed-phrase

Private Keys Module

Adds the capability to store extra private keys on the metadata.

@tkey/private-keys

npm install --save @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: