Skip to content

Commit 483a73f

Browse files
authored
Server wallets Tutorial (#2416)
1 parent 69fef87 commit 483a73f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+515
-332
lines changed

embedded-wallets/authentication/basic-logins/email-passwordless.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import { type Web3AuthContextConfig } from '@web3auth/modal/react'
7373

7474
const web3AuthContextConfig: Web3AuthContextConfig = {
7575
web3AuthOptions: {
76-
clientId: 'YOUR_CLIENT_ID',
76+
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
7777
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
7878
modalConfig: {
7979
connectors: {

embedded-wallets/authentication/basic-logins/sms-otp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import { type Web3AuthContextConfig } from '@web3auth/modal/react'
7272

7373
const web3AuthContextConfig: Web3AuthContextConfig = {
7474
web3AuthOptions: {
75-
clientId: 'YOUR_CLIENT_ID',
75+
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
7676
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
7777
modalConfig: {
7878
connectors: {

embedded-wallets/connect-blockchain/_node-connect-blockchain/_evm-initialisation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { Web3Auth } = require('@web3auth/node-sdk')
33

44
const web3auth = new Web3Auth({
5-
clientId: 'YOUR_CLIENT_ID',
5+
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
66
web3AuthNetwork: 'sapphire_mainnet', // or 'sapphire_devnet'
77
})
88

embedded-wallets/connect-blockchain/solana/react.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ npm install @solana/web3.js
9090
### Get Solana Wallet
9191

9292
```tsx
93-
import { useSolanaWallet } from '@web3auth/modal/react'
93+
import { useSolanaWallet } from '@web3auth/modal/react/solana'
9494

9595
function SolanaWallet() {
9696
const { address, connected } = useSolanaWallet()
@@ -108,7 +108,7 @@ function SolanaWallet() {
108108
### Sign Message
109109

110110
```tsx
111-
import { useSignMessage } from '@web3auth/modal/react'
111+
import { useSignMessage } from '@web3auth/modal/react/solana'
112112

113113
function SignMessage() {
114114
const { signMessage, isPending, error } = useSignMessage()
@@ -138,7 +138,7 @@ function SignMessage() {
138138
### Sign Transaction
139139

140140
```tsx
141-
import { useSignTransaction } from '@web3auth/modal/react'
141+
import { useSignTransaction } from '@web3auth/modal/react/solana'
142142
import { Transaction, SystemProgram, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js'
143143

144144
function SignTransaction() {
@@ -177,7 +177,7 @@ function SignTransaction() {
177177
### Sign and Send Transaction
178178

179179
```tsx
180-
import { useSignAndSendTransaction } from '@web3auth/modal/react'
180+
import { useSignAndSendTransaction } from '@web3auth/modal/react/solana'
181181
import { Transaction, SystemProgram, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js'
182182

183183
function SignAndSendTransaction() {

embedded-wallets/dashboard/advanced/custom-chains.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const arbitrumChainConfig = {
6363

6464
// Initialize Web3Auth with custom chains
6565
const web3auth = new Web3Auth({
66-
clientId: 'YOUR_CLIENT_ID',
66+
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
6767
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
6868
chains: [evmChainConfig, arbitrumChainConfig], // Pass array of custom chains
6969
defaultChainId: '0x66eee', // Set default chain by chainId

embedded-wallets/sdk/_common/_aa-modal-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const privateKeyProvider = new EthereumPrivateKeyProvider({
3838

3939

4040
const web3auth = new Web3Auth({
41-
clientId: "YOUR_WEB3AUTH_CLIENT_ID",
41+
clientId: "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
4242
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
4343
privateKeyProvider,
4444
// focus-start

embedded-wallets/sdk/_common/_advanced-config-options.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Control how long users stay authenticated and how sessions persist.
1515

1616
```tsx
1717
const web3AuthOptions = {
18-
clientId: "YOUR_CLIENT_ID",
18+
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
1919
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
2020

2121
// Session configuration
2222
sessionTime: 86400 * 7, // 7 days (in seconds)
23-
storageType: "local", // 'local' (persistent across tabs) or 'session' (single tab only)
24-
};
23+
storageType: 'local', // 'local' (persistent across tabs) or 'session' (single tab only)
24+
}
2525
```
2626

2727
## Multi-Factor Authentication (MFA)

embedded-wallets/sdk/android/README.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ import com.web3auth.core.types.Web3AuthOptions
153153
var web3Auth = Web3Auth(
154154
Web3AuthOptions(
155155
context = this,
156-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
156+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
157157
network = Network.MAINNET,
158158
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
159159
)
@@ -234,7 +234,7 @@ Head over to the advanced configuration sections to learn more about each config
234234
val web3Auth = Web3Auth(
235235
Web3AuthOptions(
236236
context = this,
237-
clientId = "YOUR_CLIENT_ID",
237+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
238238
network = Network.SAPPHIRE_MAINNET, // or Network.SAPPHIRE_DEVNET
239239
redirectUrl = "YOUR_APP_SCHEME://auth"
240240
)
@@ -249,7 +249,7 @@ val web3Auth = Web3Auth(
249249
val web3Auth = Web3Auth(
250250
Web3AuthOptions(
251251
context = this,
252-
clientId = "YOUR_CLIENT_ID",
252+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
253253
network = Network.SAPPHIRE_MAINNET, // or Network.SAPPHIRE_DEVNET
254254
redirectUrl = "YOUR_APP_SCHEME://auth"
255255
loginConfig = hashMapOf("google" to LoginConfigItem(

embedded-wallets/sdk/android/advanced/README.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.web3auth.core.types.Web3AuthOptions
2121
var web3Auth = Web3Auth(
2222
Web3AuthOptions(
2323
context = this,
24-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
24+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
2525
network = Network.MAINNET,
2626
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
2727
)
@@ -105,7 +105,7 @@ Control how long users stay authenticated and how sessions persist. The session
105105
var web3Auth = Web3Auth(
106106
Web3AuthOptions(
107107
context = this,
108-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
108+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
109109
network = Network.MAINNET,
110110
sessionTime = 86400 * 7, // 7 days (in seconds)
111111
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),

embedded-wallets/sdk/android/advanced/custom-authentication.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ import com.web3auth.core.types.Web3AuthOptions
153153
val web3Auth = Web3Auth(
154154
Web3AuthOptions(
155155
context = this,
156-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
156+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
157157
network = Network.MAINNET,
158158
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
159159
// focus-start
@@ -184,7 +184,7 @@ import com.web3auth.core.types.Web3AuthOptions
184184
val web3Auth = Web3Auth(
185185
Web3AuthOptions(
186186
context = this,
187-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
187+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
188188
network = Network.MAINNET,
189189
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
190190
// focus-start
@@ -218,7 +218,7 @@ import com.web3auth.core.types.Web3AuthOptions
218218
val web3Auth = Web3Auth(
219219
Web3AuthOptions(
220220
context = this,
221-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
221+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
222222
network = Network.MAINNET,
223223
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
224224
// focus-start
@@ -249,7 +249,7 @@ import com.web3auth.core.types.Web3AuthOptions
249249
val web3Auth = Web3Auth(
250250
Web3AuthOptions(
251251
context = this,
252-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
252+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
253253
network = Network.MAINNET,
254254
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
255255
// focus-start
@@ -370,7 +370,7 @@ import com.web3auth.core.types.Web3AuthOptions
370370
val web3Auth = Web3Auth(
371371
Web3AuthOptions(
372372
context = this,
373-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
373+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
374374
network = Network.MAINNET,
375375
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
376376
// focus-start
@@ -411,7 +411,7 @@ import com.web3auth.core.types.Web3AuthOptions
411411
val web3Auth = Web3Auth(
412412
Web3AuthOptions(
413413
context = this,
414-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
414+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
415415
network = Network.MAINNET,
416416
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
417417
// focus-start
@@ -450,7 +450,7 @@ import com.web3auth.core.types.Web3AuthOptions
450450
val web3Auth = Web3Auth(
451451
Web3AuthOptions(
452452
context = this,
453-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
453+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
454454
network = Network.MAINNET,
455455
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
456456
)
@@ -479,7 +479,7 @@ import com.web3auth.core.types.Web3AuthOptions
479479
val web3Auth = Web3Auth(
480480
Web3AuthOptions(
481481
context = this,
482-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
482+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
483483
network = Network.MAINNET,
484484
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
485485
)
@@ -510,7 +510,7 @@ import com.web3auth.core.types.Web3AuthOptions
510510
val web3Auth = Web3Auth(
511511
Web3AuthOptions(
512512
context = this,
513-
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass over your Web3Auth Client ID from Developer Dashboard
513+
clientId = "YOUR_WEB3AUTH_CLIENT_ID", // Pass your Web3Auth Client ID, ideally using an environment variable
514514
network = Network.MAINNET,
515515
redirectUrl = Uri.parse("{YOUR_APP_PACKAGE_NAME}://auth"),
516516
// focus-start

0 commit comments

Comments
 (0)