@web3auth/modal 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/dist/modal.cjs.js +1145 -0
- package/dist/modal.cjs.js.map +1 -0
- package/dist/modal.esm.js +860 -0
- package/dist/modal.esm.js.map +1 -0
- package/dist/modal.umd.min.js +3 -0
- package/dist/modal.umd.min.js.LICENSE.txt +99 -0
- package/dist/modal.umd.min.js.map +1 -0
- package/dist/types/config.d.ts +6 -0
- package/dist/types/default.d.ts +6 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interface.d.ts +8 -0
- package/dist/types/modalManager.d.ts +67 -0
- package/dist/types/utils.d.ts +9 -0
- package/package.json +65 -0
- package/src/config.ts +93 -0
- package/src/default.ts +47 -0
- package/src/index.ts +3 -0
- package/src/interface.ts +9 -0
- package/src/modalManager.ts +351 -0
- package/src/utils.ts +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Web3Auth Plug and Play Modal
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@web3auth/modal/v/latest)
|
|
4
|
+
[](https://bundlephobia.com/result?p=@web3auth/modal@latest)
|
|
5
|
+
|
|
6
|
+
> 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.
|
|
7
|
+
|
|
8
|
+
This package provides main class for using default Web3Auth Modal. The package includes all of our packages and gives you a simple way of implementing Web3Auth within your interface. Additionally, it is a child class of [`@web3auth/core`](https://web3auth.io/docs/sdk/web/core/) package. Hence, you can still call all the functions available in the [`@web3auth/core`](https://web3auth.io/docs/sdk/web/core/) package.
|
|
9
|
+
|
|
10
|
+
## 📖 Documentation
|
|
11
|
+
|
|
12
|
+
Checkout the official [Web3Auth Documentation](https://web3auth.io/docs/sdk/web/web3auth/) to get started.
|
|
13
|
+
|
|
14
|
+
## 💡 Features
|
|
15
|
+
- Plug and Play, OAuth based Web3 Authentication Service
|
|
16
|
+
- Fully decentralized, non-custodial key infrastructure
|
|
17
|
+
- End to end Whitelabelable solution
|
|
18
|
+
- Threshold Cryptography based Key Reconstruction
|
|
19
|
+
- Multi Factor Authentication Setup & Recovery (Includes password, backup phrase, device factor editing/deletion etc)
|
|
20
|
+
- Support for WebAuthn & Passwordless Login
|
|
21
|
+
- Support for connecting to multiple wallets
|
|
22
|
+
- DApp Active Session Management
|
|
23
|
+
|
|
24
|
+
...and a lot more
|
|
25
|
+
|
|
26
|
+
## 🔗 Installation
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
npm install --save @web3auth/modal
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ⚡ Quick Start
|
|
33
|
+
|
|
34
|
+
### Get your Client ID from Web3Auth Dashboard
|
|
35
|
+
|
|
36
|
+
Hop on to the [Web3Auth Dashboard](https://dashboard.web3auth.io/) and create a new project. Use the Client ID of the project to start your integration.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
### Initialize Web3Auth for your preferred blockchain
|
|
41
|
+
|
|
42
|
+
Web3Auth needs to initialise as soon as your app loads up to enable the user to log in. Preferably done within a constructor, initialisation 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:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import { Web3Auth } from "@web3auth/modal";
|
|
46
|
+
|
|
47
|
+
//Initialize within your constructor
|
|
48
|
+
const web3auth = new Web3Auth({
|
|
49
|
+
clientId: "", // Get your Client ID from Web3Auth Dashboard
|
|
50
|
+
chainConfig: {
|
|
51
|
+
chainNamespace: "eip155",
|
|
52
|
+
chainId: "0x1",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await web3auth.initModal();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Login your User
|
|
60
|
+
|
|
61
|
+
Once you're done initialising, just create a button that triggers to open the login modal for the user on their request. Logging in is as easy as:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
await web3auth.connect();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 🩹 Examples
|
|
68
|
+
|
|
69
|
+
Checkout the examples for your preferred blockchain and platform in our [examples repository](https://github.com/Web3Auth/examples/tree/main/web-modal-sdk)
|
|
70
|
+
|
|
71
|
+
## 🌐 Demo
|
|
72
|
+
|
|
73
|
+
Checkout the [Web3Auth Demo](https://demo-app.web3auth.io/) to see how Web3Auth can be used in your application.
|
|
74
|
+
|
|
75
|
+
## 💬 Troubleshooting and Discussions
|
|
76
|
+
|
|
77
|
+
- Have a look at our [GitHub Discussions](https://github.com/Web3Auth/Web3Auth/discussions?discussions_q=sort%3Atop) to see if anyone has any questions or issues you might be having.
|
|
78
|
+
- Checkout our [Troubleshooting Documentation Page](https://web3auth.io/docs/troubleshooting) to know the common issues and solutions
|
|
79
|
+
- Join our [Discord](https://discord.gg/web3auth) to join our community and get private integration support or help with your integration.
|