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
* [View all available social auth methods](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure)
31
34
*
32
35
* ### Enable smart accounts and sponsor gas for your users:
33
36
*
37
+
* With the `executionMode` option, you can enable smart accounts and sponsor gas for your users.
38
+
*
39
+
* **Using EIP-7702** (recommended):
40
+
*
41
+
* On chains with EIP-7702 enabled, you can upgrade the inapp wallet to a smart account, keeping the same address and performance as the regular EOA.
42
+
*
34
43
* ```ts
35
44
* import { inAppWallet } from "thirdweb/wallets";
36
45
* import { sepolia } from "thirdweb/chains";
37
46
*
38
47
* const wallet = inAppWallet({
39
-
* smartAccount: {
40
-
* chain: sepolia,
48
+
* executionMode: {
49
+
* mode: "EIP7702",
41
50
* sponsorGas: true,
42
-
* },
51
+
* },
43
52
* });
44
53
*
45
54
* // account will be a smart account with sponsored gas enabled
@@ -49,8 +58,28 @@ import type { InAppWalletCreationOptions } from "../core/wallet/types.js";
49
58
* });
50
59
* ```
51
60
*
61
+
* **Using EIP-4337**:
62
+
*
63
+
* On chains without EIP-7702 enabled, you can still use smart accounts using EIP-4337, this will return a different address (the smart contract address) than the regular EOA.
64
+
*
65
+
* ```ts
66
+
* import { inAppWallet } from "thirdweb/wallets/in-app";
67
+
*
68
+
* const wallet = inAppWallet({
69
+
* executionMode: {
70
+
* mode: "EIP4337",
71
+
* smartAccount: {
72
+
* chain: sepolia, // chain required for EIP-4337
73
+
* sponsorGas: true,
74
+
* }
75
+
* },
76
+
* });
77
+
* ```
78
+
*
52
79
* ### Login with email
53
80
*
81
+
* To login with email, you can use the `preAuthenticate` function to first send a verification code to the user's email, then login with the verification code.
82
+
*
54
83
* ```ts
55
84
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
56
85
*
@@ -73,22 +102,10 @@ import type { InAppWalletCreationOptions } from "../core/wallet/types.js";
73
102
* });
74
103
* ```
75
104
*
76
-
* ### Login with SIWE
77
-
* ```ts
78
-
* import { inAppWallet, createWallet } from "thirdweb/wallets";
105
+
* ### Login with phone number
79
106
*
80
-
* const rabby = createWallet("io.rabby");
81
-
* const inAppWallet = inAppWallet();
107
+
* Similar to email, you can login with a phone number by first sending a verification code to the user's phone number, then login with the verification code.
82
108
*
83
-
* const account = await inAppWallet.connect({
84
-
* strategy: "wallet",
85
-
* chain: mainnet,
86
-
* wallet: rabby,
87
-
* client: MY_CLIENT
88
-
* });
89
-
* ```
90
-
*
91
-
* ### Login with phone number
92
109
* ```ts
93
110
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
94
111
*
@@ -111,8 +128,28 @@ import type { InAppWalletCreationOptions } from "../core/wallet/types.js";
111
128
* });
112
129
* ```
113
130
*
131
+
* ### Login with another wallet (SIWE)
132
+
*
133
+
* You can also login to the in-app wallet with another existing wallet by signing a standard Sign in with Ethereum (SIWE) message.
134
+
*
135
+
* ```ts
136
+
* import { inAppWallet, createWallet } from "thirdweb/wallets";
137
+
*
138
+
* const rabby = createWallet("io.rabby");
139
+
* const inAppWallet = inAppWallet();
140
+
*
141
+
* const account = await inAppWallet.connect({
142
+
* strategy: "wallet",
143
+
* chain: mainnet,
144
+
* wallet: rabby,
145
+
* client: MY_CLIENT
146
+
* });
147
+
* ```
148
+
*
114
149
* ### Login with passkey
115
150
*
151
+
* You can also login with a passkey. This mode requires specifying whether it should create a new passkey, or sign in with an existing passkey. We recommend checking if the user has a passkey stored in their browser to automatically login with it.
152
+
*
116
153
* ```ts
117
154
* import { inAppWallet, hasStoredPasskey } from "thirdweb/wallets/in-app";
118
155
*
@@ -128,6 +165,11 @@ import type { InAppWalletCreationOptions } from "../core/wallet/types.js";
128
165
* ```
129
166
*
130
167
* ### Connect to a guest account
168
+
*
169
+
* You can also connect to a guest account, this will create a new account for the user instantly and store it in the browser's local storage.
170
+
*
171
+
* You can later "upgrade" this account by linking another auth method, like email or phone for example. This will preserve the account's address and history.
0 commit comments