@@ -18,11 +18,15 @@ expands accessibility—especially in regions where social login options may be
1818To use this feature, developers must first enable ` Email Passwordless ` from the Social Connections
1919section in the [ Web3Auth Dashboard] ( https://dashboard.web3auth.io ) .
2020
21- <div style = { { flexBasis : " 300px " , flexGrow : " 1 " , textAlign: " center " }} >
21+ <div style = { { display : " flex " , margin : " 20px 0 " }} >
2222 <img
2323 src = { EmailPasswordlessToggle }
24- style = { { alignSelf: " center" , maxWidth: " 100%" }}
2524 alt = " Email Passwordless Toggle"
25+ style = { {
26+ maxWidth: " 600px" ,
27+ borderRadius: " 8px" ,
28+ boxShadow: " 0 2px 6px rgba(0, 0, 0, 0.1)" ,
29+ }}
2630 />
2731</div >
2832
@@ -41,68 +45,60 @@ Follow these steps:
41454 . Enter your custom ` Auth Connection ID ` .
42465 . Click ` Add Connection ` to complete the setup.
4347
44- <div style = { { flexBasis : " 300px " , flexGrow : " 1 " , textAlign: " center " }} >
48+ <div style = { { display : " flex " , margin : " 20px 0 " }} >
4549 <img
4650 src = { EmailPasswordlessAddConnection }
47- style = { { alignSelf: " center" , maxWidth: " 100%" }}
4851 alt = " Email Passwordless Add Connection"
52+ style = { {
53+ maxWidth: " 600px" ,
54+ borderRadius: " 8px" ,
55+ boxShadow: " 0 2px 6px rgba(0, 0, 0, 0.1)" ,
56+ }}
4957 />
5058</div >
5159
5260## Usage
5361
54- <div style = { { flexBasis : " 300px " , flexGrow : " 1 " , textAlign: " left " }} >
62+ <div style = { { display : " flex " , margin : " 20px 0 " }} >
5563 <img
5664 src = { EmailPasswordlessOnboarding }
57- style = { { alignSelf: " center" , maxWidth: " 100%" }}
5865 alt = " Email Passwordless Onboarding"
66+ style = { {
67+ maxWidth: " 600px" ,
68+ border: " 1px solid #eaeaea" ,
69+ borderRadius: " 8px" ,
70+ boxShadow: " 0 2px 6px rgba(0, 0, 0, 0.1)" ,
71+ }}
5972 />
6073</div >
6174
62- ``` js title="Example: React + Vite (main.tsx)"
63- import { StrictMode } from " react" ;
64- import { createRoot } from " react-dom/client" ;
65- import " ./index.css" ;
66-
67- import {
68- Web3AuthProvider ,
69- WALLET_CONNECTORS ,
70- AUTH_CONNECTION ,
71- WEB3AUTH_NETWORK ,
72- } from " @web3auth/modal/react" ;
73-
74- import App from " ./App.tsx" ;
75-
76- createRoot (document .getElementById (" root" )! ).render (
77- < StrictMode>
78- < Web3AuthProvider
79- config= {{
80- web3AuthOptions: {
81- clientId: " WEB3AUTH_CLIENT_ID" , // Replace with your Client ID
82- web3AuthNetwork: WEB3AUTH_NETWORK .SAPPHIRE_DEVNET ,
83- modalConfig: {
84- connectors: {
85- [WALLET_CONNECTORS .AUTH ]: {
86- label: " auth" ,
87- loginMethods: {
88- // highlight-start
89- email_passwordless: {
90- name: " Email Passwordless" ,
91- authConnection: AUTH_CONNECTION .EMAIL_PASSWORDLESS ,
92- authConnectionId: " ep-test-demo" , // Replace with your custom Email Auth Connection ID
93- },
94- // highlight-end
95- },
96- },
75+ ``` tsx title="web3authContext.tsx"
76+ import { WALLET_CONNECTORS , WEB3AUTH_NETWORK } from " @web3auth/modal" ;
77+ import { type Web3AuthContextConfig } from " @web3auth/modal/react" ;
78+
79+ const web3AuthContextConfig: Web3AuthContextConfig = {
80+ web3AuthOptions: {
81+ clientId: " YOUR_CLIENT_ID" ,
82+ web3AuthNetwork: WEB3AUTH_NETWORK .SAPPHIRE_MAINNET ,
83+ modalConfig: {
84+ connectors: {
85+ [WALLET_CONNECTORS .AUTH ]: {
86+ label: " auth" ,
87+ // focus-start
88+ loginMethods: {
89+ email_passwordless: {
90+ name: " email passwordless login" ,
91+ authConnectionId: " w3a-email_passwordless-demo" ,
9792 },
9893 },
94+ // focus-end
9995 },
100- }}
101- >
102- < App / >
103- < / Web3AuthProvider >
104- < / StrictMode >
105- ) ;
96+ },
97+ },
98+ },
99+ };
100+
101+ export default web3AuthContextConfig ;
106102```
107103
108104Follow our [ Quickstart Guide] ( /quick-start ) to setup the basic flow.
0 commit comments