Installation
While installing Web3Auth Self Host, you have two options.
- Standard Installation: Get started with all the available tKey SDKs & Modules and configure your application accordingly.
- Custom Installation: Pick and choose the tKey SDKs & Modules you want to use for your implementation.
Standard Installation
For the standard installation, we recommend installing the tkey/default
SDK. This package contains all the needed functionalities of the tkey
SDK.
Within one bundle you can import all the needed SDKs and get started with working on your Web3Auth Self Host implementation.
@tkey/default
- npm
- Yarn
npm install --save @tkey/default
yarn add @tkey/default
Custom Installation
For the standard installation, you can pick and choose the SDKs and Modules you want to include. To start off, you need to install the tkey/core
SDK. This SDK is needed for setting up the basic functionality, ie. generating a tkey
.
@tkey/core
- npm
- Yarn
npm install --save @tkey/core
yarn add @tkey/core
Adding the Service Provider
Service Provider in tKey
is used for generating a Share B, ie. the private key share managed by a wallet service
provider via their own authentication flows. This share in the Web3Auth Plug and Play setup generally refers to the social login aspect, where we
associate a private key share with the social login of the user, enabling the seamless login experience.
In the Web3Auth Self Host setup, you have to use the Web3Auth Service Provider (@tkey/service-provider-torus
), which is basically implements
Web3Auth's Social Login feature as a service provider, enabling you to associate the social login of the user as one of the shares.
@tkey/service-provider-torus
- npm
- Yarn
npm install --save @tkey/service-provider-torus
yarn add @tkey/service-provider-torus
Adding the Storage Layer
The storage layer is needed to store and recall metadata information of the shares generated so as to be able to recover the private key from the
tKeys generated. For this we use the @tkey/storage-layer-torus
SDK, giving you the ability to get and set the Metadata for the various shares
generated.
@tkey/storage-layer-torus
- npm
- Yarn
npm install --save @tkey/storage-layer-torus
yarn add @tkey/storage-layer-torus
Adding Modules
Modules extend the capability of the tKey SDK to provide additional functionality for managing your tkey shares. Out of the multiple modules available, you can pick and choose the module you want to include in your implementation. Here is the list of available modules:
tKey Chrome Storage Module
@tkey/chrome-storage
: Adds the capability to add or remove a share from the chrome extension storage.tKey Web Storage Module
@tkey/web-storage
: Adds the capability to add or remove a share from the local and file storage.tKey Security Questions Module
@tkey/security-questions
: Adds the capability to add or remove a security question and password as a share.tKey Share Transfer Module
@tkey/share-transfer
: Adds the capability to transfer a share to another device.tKey Seed Phrase Module
@tkey/seed-phrase
: Adds the capability to store and use seedphrases on the metadata.tKey Private Keys Module
@tkey/private-keys
: Adds the capability to store extra private keys on the metadatatKey Share Serialization Module
@tkey/share-serialization
: Adds the capability to import/ export a share fromtKey
Troubleshooting
Webpack 5 Issues
With the latest version of webpack, you might face issues mentioning that certain dependencies are missing. These dependencies need to be polyfilled in your application and your app needs to be reconfigured to use them while building. Checkout out our dedicated guide for fixing it, if you're facing this problem.