You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Web3Auth is where passwordless auth meets non-custodial key infrastructure for Web3 apps and wallets. By aggregating OAuth (Google, Twitter, Discord) logins, different wallets and innovative Multi Party Computation (MPC) - Web3Auth provides a seamless login experience to every user on your application.
Web3Auth Single Factor Auth is the SDK that gives you the ability to start with just one key (aka, Single Factor) with Web3Auth, giving you the flexibility of implementing your own UI and UX.
Hop on to the Web3Auth Dashboard and create a new project. Use the Client ID of the project to start your integration.
Initialize Web3Auth for your preferred blockchain
Web3Auth needs to initialize as soon as your app loads up to enable the user to log in. Preferably done within a constructor, initialization is the step where you can pass on all the configurations for Web3Auth you want. A simple integration for Ethereum blockchain will look like this:
Note
This package can only be used with verifiers created on the developer dashboard.
import{Web3Auth}from"@web3auth/single-factor-auth";import{EthereumPrivateKeyProvider}from"@web3auth/ethereum-provider";//Initialize within your constructorconstweb3auth=newWeb3Auth({clientId: "",// Get your Client ID from Web3Auth Dashboardweb3AuthNetwork: "mainnet",usePnPKey: false,// Setting this to true returns the same key as PnP Web SDK.// By default, this SDK returns CoreKitKey.});constchainConfig: {chainNamespace: "eip155",chainId: "0x1",rpcTarget: "https://rpc.ankr.com/eth",};constprovider=newEthereumPrivateKeyProvider({config: { chainConfig }})awaitweb3auth.init(provider);
Login your User
Once you're done initialising, just create a button that triggers login with the JWT and verifier details.
awaitweb3auth.connect({verifier: "verifier-name",// e.g. `web3auth-sfa-verifier` replace with your verifier name, and it has to be on the same network passed in init().verifierId: "verifier-id-value",// e.g. `Yux1873xnibdui` or `name@email.com` replace with your verifier id(sub or email)'s value.idToken: "JWT Token",// replace with your newly created unused JWT Token.});
Checkout the examples for your preferred blockchain and platform in our examples repository
π Demo
Checkout the Web3Auth Demo to see how Web3Auth SFA can be used in your application.
π¬ Troubleshooting and Support
Have a look at our Community Portal to see if anyone has any questions or issues you might be having. Feel free to reate new topics and we'll help you out as soon as possible.