OwnerCods / Web3Authentific

Simple infrastructure that enables Web3 wallets and applications to provide seamless user logins for both mainstream and Web3.0 users.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web3Auth

lerna code style: prettier npm GitHub Workflow Status

Web3Auth is pluggable auth infrastructure for Web3 wallets and applications. It streamlines the onboarding of both mainstream and crypto native users under a minute by providing experiences that they're most comfortable with.

With support for all social logins, web & mobile native platforms, wallets and other key management methods, Web3Auth results in a standard cryptographic key provider specific to the user and application.

Checkout the official Web3Auth Documentation and API Reference to get started!

Choosing Between SDKs

For using Web3Auth you have multiple choices to get started with. If you're just starting up and want to experience how it will look like within your application, we recommend you to use our Plug n Play SDK @web3auth/web3auth which is a simple and easy to use SDK that will give you a simple modular way of implementing Web3Auth directly within your application.

For more customised usage, we have our Custom Login UI Module @web3auth/core, which is the core module implementing the features you need and giving you the flexibilty of using your own UI with the Web3Auth SDK working in the backend.

Plug n Play SDK

This package provides main class for using default web3auth modal. It inherits @web3auth/core package. So you can still call all the functions available in the @web3auth/core api reference. The package includes all of our packages and gives you a simple way of implementing Web3Auth within your interface.

Installation

npm

npm i --save @web3auth/web3auth

yarn

yarn add @web3auth/web3auth

Head on to the Plug n Play API Reference to get started.

Custom Login UI SDK

This package provides the core logic for handling adapters within web3auth. This package acts as a manager for all the adapters. You should use this package to build your custom login UI on top of web3auth.

Installation

npm

npm i --save @web3auth/core

yarn

yarn add @web3auth/core

Head on to the Custom Login UI API Reference to get started.

Other packages included in our SDK

This package gives access to common types and interfaces for web3auth. It is included as a dependency in both our Custom UI and Plug n Play SDKs.

This package includes the default Web3Auth modal UI for modular access within the Plug n Play SDK. It is included as a dependency in our Plug n Play SDK.

Adapter packages

Adapter acts as a connector between the Web3Auth and underlying wallet provider. Every adapter follows a common interface which is required by Web3Auth to communicate with the wallet.

To understand what they are and what they're for: Check out Adapters

Currently we have the following adapters available for utilisation:

Provider packages

Each adapter in web3auth exposes a provider on successful user authentication. This provider can be use to interact with wallet or connected chain using rpc calls. Currently web3auth supports providers for both EVM and Solana chains. For other chains, one can easily get the private key from the web3auth SDK. You can learn more about providers here.

Plugin packages

Each plugin in web3auth enhances the functionality of web3auth sdk by providing additional features. Currently web3auth supports plugins for both EVM and Solana wallets.

Bundling

This module is distributed in 4 formats

  • esm build dist/package.esm.js in es6 format
  • commonjs build dist/package.cjs.js in es5 format
  • umd build dist/package.umd.min.js in es5 format without polyfilling corejs minified

By default, the appropriate format is used for your specified usecase You can use a different format (if you know what you're doing) by referencing the correct file

The cjs build is not polyfilled with core-js. It is upto the user to polyfill based on the browserlist they target

Directly in Browser

CDN's serve the non-core-js polyfilled version by default. You can use a different

Please replace package and version with the appropriate package name

jsdeliver

<script src="https://cdn.jsdelivr.net/npm/@web3auth/PACKAGE@VERSION"></script>

unpkg

<script src="https://unpkg.com/@web3auth/PACKAGE@VERSION"></script>
Packages @latest Version Size Description
🏠 Core
@web3auth/core npm version minzip Provides the core logic for handling adapters within web3auth. This package acts as a manager for all the adapters. You should use this package to build your custom login UI on top of web3auth.
@web3auth/web3auth npm version minzip Provides the main class for using default web3auth modal. It inherits @web3auth/core package. So you can still call all the functions available in the @web3auth/core api reference. The package includes all of our packages and gives you a simple way of implementing Web3Auth within your interface.
πŸ”Œ Adapters
@web3auth/coinbase-adapter npm version minzip Adds coinbase login functionality
@web3auth/metamask-adapter npm version minzip Adds metamask chrome extension login functionality
@web3auth/openlogin-adapter npm version minzip Adds social logins with MFA functionality
@web3auth/phantom-adapter npm version minzip Adds phantom chrome extension login functionality
@web3auth/torus-evm-adapter npm version minzip Adds Torus Wallet login functionality (https://app.tor.us)
@web3auth/torus-solana-adapter npm version minzip Adds Solana Torus Wallet login functionality (https://solana.tor.us)
@web3auth/wallet-connect-v1-adapter npm version minzip Adds wallet connect v1 login functionality + all supported adapters (eg: Metamask mobile, rainbow etc.)
πŸ‰ Providers
@web3auth/base-provider npm version minzip Base implementation of JRPC provider
@web3auth/ethereum-provider npm version minzip EIP-1193 compatible JRPC provider
@web3auth/solana-provider npm version minzip Solana chain compatible JRPC provider
πŸ‰ Plugins
@web3auth/base-plugin npm version minzip Base implementation of plugin
@web3auth/torus-wallet-connector-plugin npm version minzip Allows to inject your web3auth scoped private key into torus wallet UI (https://app.tor.us)
@web3auth/solana-wallet-connector-plugin npm version minzip Allows to inject your web3auth scoped private key into torus solana wallet UI (https://solana.tor.us)
πŸ‰ Low-Level
@web3auth/base npm version minzip Base reusable functionalities for creating a web3auth instance
@web3auth/ui npm version minzip Provides the UI used for creating the modal

Examples

Please refer to examples

Hosted Example for testing

Requirements

  • All packages require a peer dependency of @babel/runtime
  • Node 12+

About

Simple infrastructure that enables Web3 wallets and applications to provide seamless user logins for both mainstream and Web3.0 users.


Languages

Language:TypeScript 88.0%Language:CSS 5.9%Language:JavaScript 3.1%Language:HTML 3.0%Language:Shell 0.0%