Skip to content

Commit d99ac45

Browse files
authored
Embedded Wallets: combined SDK docs updates (iOS, Android, Web, Flutter, React Native) and rebrand (#3086)
* Rebrand Embedded Wallets to Web3Auth by MetaMask, Embedded Wallet SDK Replace the "MetaMask Embedded Wallets" and "MetaMask Embedded Wallet(s) SDK" names with "Web3Auth by MetaMask, Embedded Wallet SDK" across the docs. - Use the full name on first mention in each page body, in page descriptions, and on standalone cards; use "Embedded Wallet SDK" in headings, titles, sidebar labels, and later mentions. - Name platform SDKs "Embedded Wallet SDK for <platform>". - Remove "(formerly/previously Web3Auth)" and "formerly Web3Auth Plug and Play" wording. - Normalize "Embedded Wallets SDK" to "Embedded Wallet SDK". - Update the Embedded Wallets product rule and terminology table. Package names, code identifiers, URLs, and the "Embedded Wallets" nav and dashboard labels are unchanged. * Update Embedded Wallets iOS SDK docs for v13 - Bump install instructions to web3auth-swift-sdk 13.0.0. - Rewrite the iOS migration guide to cover v6 through v12 to v13, with a new v13 section and a corrected v12 rename table. - Fix Swift snippets that didn't compile because labeled arguments were out of declaration order (Web3AuthOptions, Chains, AuthConnectionConfig, LoginParams). - Document all Web3AuthOptions parameters, the dashboard-driven sessionTime default, and chain precedence for Wallet Services. - Remove MFALevel.DEFAULT and unsupported ChainNamespace and ExtraLoginOptions values. - Correct enableMFA and manageMFA guidance for SFA users. - Add getIdentityToken, getAccessToken, refreshSession, and getUserInfoAsync docs. - Add tncLink, privacyPolicy, enableKeyExport, and autoApprove options. - Fix iOS quickstart step highlights, connect-blockchain snippets, and the examples list. * Audit Embedded Wallets Web SDK docs against @web3auth/modal v11.4.3 Verify JS, React, and Vue SDK pages, the web migration guide, feature, dashboard, troubleshooting, connect-blockchain, quickstart, and tutorial content against the v11.4.3 SDK source and the official examples. - Fix samples that would not compile (Wallet Services plugin usage, removed Solana types, getViewChain, wrong type imports) - Replace removed or renamed options and properties (storageType, eipStandard, connectedConnectorName, getUserInfo v9 fields, verifierIdField) - Correct hook/composable signatures and return fields; Vue refs - Fix Solana chain IDs (0x65-0x67) and XRPL provider setup - Correct migration guide breaking changes; add v11.1-v11.4 changes - Fix multi-wallet linking API usage - Add React and Vue pages for useChain, useWallets, useFunding, useReceive, useLinkAccount, useSwitchAccount, useX402Fetch, and Vue useSolanaClient - Fix Angular and Next.js quickstart builder steps * Update Flutter SDK docs for web3auth_flutter v8 Align the Embedded Wallets Flutter documentation with web3auth_flutter 8.0.0 (Auth v11 / Wallet Services v6, Android native 11.0.0, iOS native 13.0.0). - Rewrite the Flutter migration guide for v8 (covers v3 through v7). - Document Swift Package Manager requirement for iOS. - Remove MFALevel.DEFAULT and fix the MFA settings example. - Make sessionTime optional (dashboard value by default). - Wrap initialize() in try/catch across samples. - Complete the Web3AuthOptions, WhiteLabelData, WalletServicesConfig, Chains, LoginParams, and Web3AuthResponse references. - Add usage pages for getAccessToken, getIdentityToken, refreshSession, and getWeb3AuthResponse; document getUserInfoAsync. - Update Flutter snippets in SocialLoginExamples and PasswordlessLoginExamples from the pre-v7 login API to connectTo. - Update the Flutter quickstart, tutorial, and Solana page. * Update Embedded Wallets Android SDK docs for v11 Align the Android SDK docs with web3auth-android-sdk 11.0.1. - Bump the dependency to 11.0.1 and minSdk to 26. - Retarget the migration guide to v11 (MFALevel.DEFAULT removal, v11/v6 service URLs, initialize() session restore, sessionTime and WalletServicesConfig defaults, new session APIs). - Add usage pages for getAccessToken/getIdentityToken and refreshSession, and document getUserInfoAsync. - Fix initialize(), getPrivateKey(), and logout() session behavior. - Fix enableMFA/manageMFA guidance (no idToken; not available for SFA). - Fix custom authentication examples (required clientId and authConnectionId, EmailFlowType values, swapped grouped connection IDs, jwtParameters). - Document SFA limitations and run SFA connectTo off the main thread. - Update Web3AuthOptions, WhiteLabelData, and WalletServicesConfig fields. - Fix the Solana, Firebase, tutorial, and quickstart Android content. * Update Embedded Wallets React Native docs for SDK v10 - Rewrite the React Native SDK pages for @web3auth/react-native-sdk 10.0.0: useWeb3Auth().connection (ethereumProvider, solanaWallet) replaces provider/signer; connectTo resolves Connection | null. - Add hook pages for useAccessToken, useAuthTokenInfo, and useRefreshSession; mark useIdentityToken deprecated. - Add Ethereum hooks (Wagmi) and Solana hooks pages, including the polyfills and @web3auth/auth shim that Solana needs on 10.0.0. - Fix connectTo parameters, web3AuthOptions, MFA levels, whitelabel fields, and Solana chain IDs (0x65/0x66/0x67). - Require react-native-quick-crypto 1.x and document the Gradle 9 jcenter() workaround for @toruslabs/react-native-web-browser. - Rewrite the React Native migration guide to target v10 (from v3-v9). - Update EVM and Solana connect-blockchain pages, Metro troubleshooting, the quickstart builder, and Auth0/Firebase React Native snippets. - Remove unused v8 account abstraction partials. * Clarify Android session time defaults to 30 days * Fix iOS v13 docs gaps found in review - Restore ChainNamespace .solana and .other; note Wallet Services are EVM only. - Note that the dashboard confirmation modal setting overrides confirmationStrategy. - Document that v13.0.0 ignores flow_type and always uses the OTP email flow. - Describe the default session time as 30 days from the dashboard, and correct the older-version defaults in the migration table. - Note that SFA users get no session tokens or Ed25519 key. - Warn that logout deletes all of the app's generic password Keychain items. - Reword the v13 MFA migration note: SFA detection is new, connection reuse isn't. - Clarify chain selection, WhiteLabelData default overrides, getEd25519PrivateKey errors, Xcode 15 and Swift 5.9 requirements, and the CocoaPods version range. - Set the dashboard session duration default to 30 days. * Fix Flutter v8 docs against native SDK behavior Verified against web3auth-android-sdk 11.0.0 and web3auth-swift-sdk 13.0.0, the versions web3auth_flutter 8.0.0 pins. - enableMFA/manageMFA: remove idToken guidance; both throw for sessions created with idToken (ENABLE_MFA_NOT_ALLOWED / enabledMfaNotAllowed). - getEd25519PrivateKey throws without a session; use getPrivateKey as the session check on the Solana page and in the tutorial. - Dapp share examples use the OAuth custom-connection flow; idToken takes the SFA path, which ignores dappShare. - connectTo errors: Android maps all failures to UserCancelledException, iOS returns PlatformException (LoginFailedException). Drop UnKnownException and use PlatformException in showWalletUI/request/MFA samples. - SPM is on by default in recent Flutter (3.44); keep the flag as fallback and set the deployment target on the Runner target. - sessionTime: lead with the 30-day default. - Note iOS project-config failures surface from init, refreshSession failure clears the session, manageMFA requires MFA enabled, and the enableKeyExport dashboard fallback. - Restore the Flutter custom authentication link, fix tutorial wording, wrap initialize() in auth0/firebase samples, and note sample imports. * Fix remaining v11.4.3 inaccuracies found in review - Remove nonexistent MFA_LEVELS.DEFAULT from React and Vue MFA pages - Vue useSignTransaction returns the base58 signature - sessionTime falls back to the dashboard value, then 30 days - Rewrite Solana Pay tutorial for v11 useSolanaWallet rpc and the @solana/kit-based @solana/pay 1.x API, with SolanaProvider - Add WalletOperationsError, WalletProviderError, and AccountLinkingError codes - Add groupedAuthConnectionId and account_abstraction to linked account fields; clarify useWallets sync behavior - getUserInfo returns { linkedAccounts: [] } for external wallets - XRPL testnet chain ID 0x6 and wsTarget labels - initialAuthenticationMode connect-only default was v10.10+ * Address review feedback on React Native v10 docs - Match the official examples: React Native 0.74 (bare) and Expo SDK 51, and the quickstart's minSdkVersion 23 / compileSdkVersion 34. - Document react-native-quick-crypto by version: 1.x (with react-native-nitro-modules and react-native-quick-base64 3.x+) for React Native 0.75+ with the New Architecture, 0.7.x otherwise. Label the 16 KB-page and randomBytes failures as observed on an emulator. - Migration guide: remove the useWeb3AuthUser row (v9 already returned isMFAEnabled and getUserInfo), describe the real connectTo change (WalletResult to Connection), and limit "doesn't throw" to the hook. - Scope smart account address order, user operations, and key export limits to ERC-4337; note EIP-7702 behavior. - Dapp share: kept until sign-out; a stored share overrides a dappShare passed to connectTo. - Quickstart: match the getWeb3AuthConfig(withAA) example and remove the unreachable wallet-aggregator step. - Add PASSKEYS and AUTHENTICATOR, walletSdkURL, AppOwnership.Guest; correct whitelabel mode default (light), dappUrl, defaultChainId fallback, provider recreation, useAuthTokenInfo token on idToken sessions, and the MFA highlight directive. - Session time defaults to the dashboard value (30 days by default). - Replace web3.js / ethers v5 wording on the React Native chain pages. * Address rebrand review: service wording, snapshots, naming slips - Credit the service, not the client SDK, for issuing ID tokens, running on the Torus Network, MPC key management, and OTP email delivery. - Show the package name in quickstart install steps so the comma in the brand name doesn't read as an extra package. - Revert Smart Accounts Kit snapshots 1.5.0 through 1.7.0 to main. - Point the "as a signer" link in eoa-wallets.md at embedded-wallets.md. - Document when to keep "Embedded Wallets" (service, nav, dashboard, unmigrated titles) in the Embedded Wallets product rule. - Use the full name on first mention on pages that only had the short form, and fix a mixed-name sentence, "SDK for Web for", and two descriptions. - Rename example card titles from "Web3Auth PnP <platform> SDK", the SDK card headings, and the Embedded Wallets llms.txt link labels. * Fix sessionTime default and max in auth adapter settings snippet The snippet labeled 7 * 86400 as 30 days and gave a 1-day default. State 30 * 86400 seconds (30 days) for both. * Fix Embedded Wallet SDK migration guides against SDK source Verified each guide against the SDK release tags and example history, and fixed incorrect mappings, missing breaking changes, and wrong version attributions. - Web: document connect()/connectTo() returning Connection, the primaryConnector* renames, CONNECTED payload change, Farcaster deprecation, required peers, SolanaProvider setup, real v9 snippet, and v9 package cleanup. - React Native: fix inverted aggregate-verifier mapping, replace nonexistent useSFAKey with keep-useCoreKitKey guidance, correct the class-removal claim, match the official Expo Metro config, and cover the ethers/signer removal and engine bump. - iOS: correct v12 SFA detection claim, move v12 behaviors out of the v13 section, and add dependency and service URL changes. - Android: target 11.0.2 (JWT Auth-first flow, MFALevel.NONE for silent SFA, MFA allowed for SFA users), safer initialize() handling, settings.gradle for JitPack, and missing v8-v10 changes. - Flutter: handle the per-project SPM opt-out from v7 examples, note Android uses only the first chain, and add missing type changes and renames. - README: Android row now v11 (from v4 through v10). * Align React Native docs with React Native 0.84 examples The official bare React Native examples now require React Native 0.84+ for the native URL API, while the Expo example stays on Expo SDK 51 (React Native 0.74) until an Expo SDK ships React Native 0.84+. - Migration guide: add a React Native version section, upgrade-first guidance, URL polyfill removal, and async-storage; drop the unverified "quick-crypto 1.x for 0.75+ New Architecture" rule in favor of what the examples use (0.7.x), with 1.x for 16 KB page Android devices. - SDK overview, troubleshooting, and quickstart: same requirements, Node 22.11+, Android SDK 36 targets, and delete (not replace) jcenter(). * Update Android, iOS, and Flutter SDK docs to current SDK behavior - Android: pin 11.0.2; document that custom JWT sign-in opens the Auth flow by default and silent SFA needs MFALevel.NONE; MFA is now allowed for idToken and SFA users; tokens are unavailable only in NONE sessions; add the refreshSession side effect and an address check. - iOS: always-OTP email passwordless started in v12.0.0, not v13. - Flutter: drop the unverified Flutter 3.44 example, warn about the per-project SPM opt-out in pubspec.yaml, and note that Android uses only the first chain. --------- Co-authored-by: Yashovardhan Agrawal <21066442+yashovardhan@users.noreply.github.com>
1 parent f58d8cc commit d99ac45

386 files changed

Lines changed: 7369 additions & 4152 deletions

File tree

Some content is hidden

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

‎.cursor/rules/product-embedded-wallets.mdc‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,28 @@ alwaysApply: false
88

99
## Product naming
1010

11-
- The product name is **MetaMask Embedded Wallets**.
12-
- Use **Embedded Wallets** (capitalized) as the short form in prose.
13-
- The SDKs are **MetaMask Embedded Wallet SDKs** (formerly Plug and Play).
11+
- The product name is **Web3Auth by MetaMask, Embedded Wallet SDK**. It replaces the former name
12+
"MetaMask Embedded Wallets".
13+
- Always include the comma, including in running prose (for example, "the Web3Auth by MetaMask,
14+
Embedded Wallet SDK"). Never write "Web3Auth by MetaMask Embedded Wallet SDK".
15+
- Do not add "formerly Web3Auth", "previously Web3Auth", or "formerly Web3Auth Plug and Play".
16+
- Use the full name once, on first mention in a page's body, and in page descriptions and
17+
standalone cards. Everywhere else, including headings, page titles, and sidebar labels, use
18+
the short form (for example, "Is the Embedded Wallet SDK a wallet?").
19+
- Use **Embedded Wallet SDK** (singular "Wallet") as the short form, and **Embedded Wallet SDKs**
20+
for the plural. Do not use "MetaMask Embedded Wallets", "Embedded Wallets SDK", or "MetaMask
21+
Embedded Wallet SDK".
22+
- For a platform SDK, use "Web3Auth by MetaMask, Embedded Wallet SDK for <platform>" (for
23+
example, "for React" or "for iOS").
24+
- Keep **Embedded Wallets** (not the SDK name) for:
25+
- The service and infrastructure, which the client SDK does not run. For example, write
26+
"Embedded Wallets issues ID tokens", not "the Embedded Wallet SDK issues ID tokens".
27+
- The top navigation and sidebar labels, the **Embedded Wallets dashboard**, and the
28+
`/embedded-wallets/` URLs.
29+
- Existing page titles and descriptions that have not been migrated yet. Do not rename these in
30+
bulk without approval from the documentation team.
31+
The "headings, page titles, and sidebar labels" rule above applies only where the text names the
32+
SDK.
1433
- Package names and code identifiers still use `web3auth` (for example, `@web3auth/modal`). Do not
1534
rename these in code samples.
1635
- Do not describe Embedded Wallets as a "wallet." It is **embedded wallet infrastructure** that

‎.cursor/rules/terminology.mdc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ listed on the right unless they appear in code, URLs, or direct quotations from
3131
| server-wallet | server wallet, Server Wallet (except as product phrase "server-wallet mode") |
3232
| Bring your own wallet | BYOK, bring your own key, byok (except CLI flag `--wallet byok`) |
3333
| `mm` (CLI binary) | MM, Mm (except at sentence start) |
34+
| Web3Auth by MetaMask, Embedded Wallet SDK (product name) | MetaMask Embedded Wallets, MetaMask Embedded Wallet SDK, Web3Auth PnP SDK, Web3Auth by MetaMask Embedded Wallet SDK (no comma) |
35+
| Embedded Wallet SDK (short form) | Embedded Wallets SDK |
3436

3537
## Standards and specifications
3638

‎embedded-wallets/README.mdx‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: What are Embedded Wallets?
33
image: 'img/metamaskog.jpg'
44
sidebar_label: About
5-
description: 'What are MetaMask Embedded Wallets? Pluggable wallet infrastructure for web3. OAuth logins, multiple platforms, non-custodial wallets.'
5+
description: 'What is the Web3Auth by MetaMask, Embedded Wallet SDK? Pluggable wallet infrastructure for web3. OAuth logins, multiple platforms, non-custodial wallets.'
66
---
77

88
import Head from '@docusaurus/Head'
@@ -20,7 +20,7 @@ import Head from '@docusaurus/Head'
2020
<meta property="og:image:type" content="image/jpeg" />
2121
<meta property="og:image:width" content="1200" />
2222
<meta property="og:image:height" content="630" />
23-
<meta property="og:image:alt" content="MetaMask Embedded Wallets" />
23+
<meta property="og:image:alt" content="Web3Auth by MetaMask, Embedded Wallet SDK" />
2424
<meta name="twitter:card" content="summary_large_image" />
2525
<meta name="twitter:site" content="@MetaMask" />
2626
<meta name="twitter:creator" content="@MetaMask" />
@@ -29,11 +29,13 @@ import Head from '@docusaurus/Head'
2929
<meta name="author" content="MetaMask" />
3030
</Head>
3131

32-
MetaMask Embedded Wallets (formerly Web3Auth) provides a pluggable embedded wallet infrastructure to
32+
The Web3Auth by MetaMask, Embedded Wallet SDK provides a pluggable embedded wallet infrastructure to
3333
simplify web3 wallet integration and user onboarding. It supports OAuth-based logins and multiple
3434
platforms, allowing your users to access web3 applications through familiar authentication methods.
3535

36-
MetaMask Embedded Wallets reduces traditional wallet management overhead by removing the need
36+
The SDK is available for [web, mobile, gaming, and backend platforms](/embedded-wallets/sdk/).
37+
38+
The Embedded Wallet SDK reduces traditional wallet management overhead by removing the need
3739
to manage private keys and seed phrases directly.
3840

3941
<p style={{ margin: '1.25rem 0' }}>
@@ -61,7 +63,7 @@ Help users get started quickly with sign-in methods they already use:
6163

6264
- Sign in with Google, Twitter, GitHub, and other popular social accounts.
6365
- Sign in with email, SMS, and authenticator apps without passwords.
64-
- Bring your own auth system while using MetaMask Embedded Wallets infrastructure.
66+
- Bring your own auth system while using the Embedded Wallet SDK infrastructure.
6567

6668
### Security
6769

@@ -73,7 +75,7 @@ Protection for your users' digital assets:
7375

7476
### Developer experience
7577

76-
Integrate MetaMask Embedded Wallets into your app with minimal setup:
78+
Integrate the Embedded Wallet SDK into your app with minimal setup:
7779

7880
- Use a drop-in solution that works with your existing auth system.
7981
- Avoid complex migrations or infrastructure changes.
@@ -89,23 +91,23 @@ Provide a low-friction path to web3:
8991
- Let users own and control their wallets.
9092
- Support account recovery flows.
9193

92-
MetaMask Embedded Wallets provides wallet infrastructure for dapps and blockchain wallets. This
94+
The Embedded Wallet SDK provides wallet infrastructure for dapps and blockchain wallets. This
9395
documentation explains how it works, including how it generates cryptographic key providers for
9496
each user and application.
9597

9698
## How do Embedded Wallets work?
9799

98100
See **[Architecture](./architecture.mdx)** for the high-level system design, SDK and integration diagram, and wallet management infrastructure.
99101

100-
## Is MetaMask Embedded Wallets a wallet?
102+
## Is the Embedded Wallet SDK a wallet?
101103

102-
MetaMask Embedded Wallets is not a wallet, but rather a wallet infrastructure that can be integrated into any application. It provides customizable authentication flows for dapps and blockchain wallets, solving user onboarding and key management challenges.
104+
The Embedded Wallet SDK is not a wallet, but rather a wallet infrastructure that can be integrated into any application. It provides customizable authentication flows for dapps and blockchain wallets, solving user onboarding and key management challenges.
103105

104-
Unlike traditional wallets that can limit user experience, MetaMask Embedded Wallets enables developers to create tailored flows without requiring users to understand complex blockchain concepts. It provides a cryptographic key provider that can be used to build custom wallets or integrate with existing ones through Web3Auth's external wallet adapters.
106+
Unlike traditional wallets that can limit user experience, the Embedded Wallet SDK enables developers to create tailored flows without requiring users to understand complex blockchain concepts. It provides a cryptographic key provider that can be used to build custom wallets or integrate with existing ones through Web3Auth's external wallet adapters.
105107

106-
## Is MetaMask Embedded Wallets scalable?
108+
## Is the Embedded Wallet SDK scalable?
107109

108-
The MetaMask Embedded Wallets infrastructure is built to handle millions of users. Our architecture provides:
110+
The Embedded Wallet SDK infrastructure is built to handle millions of users. Our architecture provides:
109111

110112
- Global availability across multiple regions with consistent low-latency performance worldwide
111113
- Automatic horizontal scaling that adjusts capacity based on demand, eliminating bottlenecks and ensuring uninterrupted service

‎embedded-wallets/architecture.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
title: Architecture
33
sidebar_label: Architecture
4-
description: 'How MetaMask Embedded Wallets fit together: SDK layout, integrations, and wallet management infrastructure.'
4+
description: 'How the Web3Auth by MetaMask, Embedded Wallet SDK fits together: SDK layout, integrations, and wallet management infrastructure.'
55
---
66

77
import PnPCoreKitFlowLight from '@site/static/img/embedded-wallets/flow-diagrams/pnp-core-kit-flow-light.png'
88
import PnPCoreKitFlowDark from '@site/static/img/embedded-wallets/flow-diagrams/pnp-core-kit-flow-dark.png'
99

10-
MetaMask Embedded Wallets includes front-end SDKs that run in your app and coordinate OAuth sign-in
10+
The Web3Auth by MetaMask, Embedded Wallet SDK includes front-end SDKs that run in your app and coordinate OAuth sign-in
1111
with the Embedded Wallets network. You use these SDKs to authenticate a user, retrieve the key
1212
material required for that user, and create a client that can sign requests on the user's behalf.
1313

1414
:::note[Rebrand]
1515

16-
The SDKs are now branded as MetaMask Embedded Wallet SDKs (formerly Web3Auth Plug and Play SDKs).
16+
The SDKs are now branded as Web3Auth by MetaMask, Embedded Wallet SDKs.
1717
Package names and APIs remain Web3Auth (for example, Web3Auth React SDK), and code snippets may reference `web3auth` identifiers.
1818

1919
:::

‎embedded-wallets/authentication/README.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ description: 'Authentication | Embedded Wallets'
77

88
import Tiles from '@theme/Tiles'
99

10-
**Embedded Wallets** (formerly Web3Auth) offers an authentication system designed to connect Web2 and web3 identity, giving you tools to implement secure, flexible, and user-friendly onboarding flows. By offering fine-grained control over login experiences and wallet integrations, Embedded Wallets helps enhance user conversion while enabling access to blockchain-based functionality.
10+
The **Web3Auth by MetaMask, Embedded Wallet SDK** offers an authentication system designed to connect Web2 and web3 identity, giving you tools to implement secure, flexible, and user-friendly onboarding flows. By offering fine-grained control over login experiences and wallet integrations, the Embedded Wallet SDK helps enhance user conversion while enabling access to blockchain-based functionality.
1111

12-
Using the Embedded Wallets SDKs, applications can authenticate users through a variety of mechanisms, supporting both traditional (Web2) and decentralized (web3) identity paradigms.
12+
Using the Embedded Wallet SDKs, applications can authenticate users through a variety of mechanisms, supporting both traditional (Web2) and decentralized (web3) identity paradigms.
1313

1414
::::note
1515

16-
The SDKs are now branded as MetaMask Embedded Wallet SDKs (formerly Web3Auth Plug and Play SDKs). Package names and APIs remain Web3Auth (for example, Web3Auth React SDK), and code snippets may reference `web3auth` identifiers.
16+
The SDKs are now branded as Web3Auth by MetaMask, Embedded Wallet SDKs. Package names and APIs remain Web3Auth (for example, Web3Auth React SDK), and code snippets may reference `web3auth` identifiers.
1717

1818
::::
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Email passwordless with Embedded Wallets
33
sidebar_label: Email passwordless
4-
description: Configure default or custom email OTP sign-in with MetaMask Embedded Wallets.
4+
description: Configure default or custom email OTP sign-in with the Web3Auth by MetaMask, Embedded Wallet SDK.
55
---
66

77
import EmailPasswordlessAddConnection from '@site/static/img/embedded-wallets/dev-dashboard/email-passwordless-add-connection.png'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: SMS OTP with Embedded Wallets
33
sidebar_label: SMS OTP
4-
description: Configure default or custom SMS OTP sign-in with MetaMask Embedded Wallets.
4+
description: Configure default or custom SMS OTP sign-in with the Web3Auth by MetaMask, Embedded Wallet SDK.
55
---
66

77
import SMSOTPAddConnection from '@site/static/img/embedded-wallets/dev-dashboard/sms-otp-add-connection.png'

‎embedded-wallets/authentication/custom-connections/auth0.mdx‎

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ Future<void> initPlatformState() async {
199199
authConnectionConfig: authConnectionConfig,
200200
));
201201
202-
await Web3AuthFlutter.initialize();
202+
try {
203+
// Restores the session if one exists. Throws when no active session is present.
204+
await Web3AuthFlutter.initialize();
205+
} catch (e) {
206+
log(e.toString());
207+
}
203208
}
204209
```
205210

@@ -228,30 +233,20 @@ Read more about initializing the Flutter SDK [here](/embedded-wallets/sdk/flutte
228233
### React Native
229234

230235
```tsx
231-
const web3auth = new Web3Auth(WebBrowser, SecureStore, {
232-
clientId,
233-
network: OPENLOGIN_NETWORK.SAPPHIRE_MAINNET, // SAPPHIRE_MAINNET or SAPPHIRE_DEVNET
234-
loginConfig: {
235-
// focus-start
236-
jwt: {
237-
verifier: 'YOUR_AUTH0_VERIFIER_NAME', // Please create a verifier on the developer dashboard and pass the name here
238-
typeOfLogin: 'jwt',
239-
clientId: 'AUTH0_CLIENT_ID_123ABcdefg4HiJKlMno4P5QR6stUvWXY', // use your app client id you got from auth0
240-
},
241-
// focus-end
242-
},
243-
})
244-
```
236+
import { AUTH_CONNECTION, useWeb3AuthConnect } from '@web3auth/react-native-sdk'
245237

246-
```tsx
247-
const web3authResponse = await web3auth.login({
248-
redirectUrl: resolvedRedirectUrl,
238+
const { connectTo } = useWeb3AuthConnect()
239+
240+
await connectTo({
241+
authConnection: AUTH_CONNECTION.CUSTOM,
249242
// focus-start
250-
loginProvider: 'jwt',
243+
authConnectionId: 'YOUR_AUTH0_CONNECTION_ID', // Connection ID from the dashboard
251244
extraLoginOptions: {
252-
domain: 'https://YOUR-AUTH0-DOMAIN', // Please append "https://" before your domain
253-
verifierIdField: 'sub', // For SMS & Email Passwordless, use "name" as verifierIdField
245+
domain: 'https://YOUR-AUTH0-DOMAIN', // Include "https://"
246+
verifierIdField: 'sub', // For SMS and email passwordless, use "name"
254247
},
255248
// focus-end
256249
})
257250
```
251+
252+
Read more about [custom authentication in the React Native SDK](/embedded-wallets/sdk/react-native/advanced/custom-authentication).

‎embedded-wallets/authentication/custom-connections/firebase.mdx‎

Lines changed: 42 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ web3Auth.setResultUrl(intent?.data)
144144

145145
Once initialized, you can use the `web3Auth.connectTo(LoginParams(...))` function to authenticate the user when they click the sign-in button.
146146

147+
Passing `idToken` uses SFA sign-in, which makes blocking network calls. Call `connectTo` from a background thread, as shown below.
148+
147149
```kotlin
150+
private val executor = Executors.newSingleThreadExecutor()
151+
148152
private fun signIn() {
149153
// focus-start
150154
auth = Firebase.auth
@@ -159,22 +163,20 @@ private fun signIn() {
159163
val idToken = result.token
160164

161165
Log.d(TAG, "GetTokenResult result = $idToken")
162-
// focus-start
163-
val loginCompletableFuture: CompletableFuture<Web3AuthResponse> = web3Auth.connectTo(
164-
LoginParams(
165-
authConnection = AuthConnection.CUSTOM,
166-
authConnectionId = "web3auth-firebase-examples",
167-
idToken = idToken
168-
)
169-
)
170-
// focus-end
171-
172-
loginCompletableFuture.whenComplete { loginResponse, error ->
173-
if (error == null) {
174-
println(loginResponse)
175-
reRender(loginResponse)
176-
} else {
177-
Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong" )
166+
executor.execute {
167+
try {
168+
// focus-start
169+
val loginResponse: Web3AuthResponse = web3Auth.connectTo(
170+
LoginParams(
171+
authConnection = AuthConnection.CUSTOM,
172+
authConnectionId = "web3auth-firebase-examples",
173+
idToken = idToken
174+
)
175+
).get()
176+
// focus-end
177+
runOnUiThread { reRender(loginResponse) }
178+
} catch (e: Exception) {
179+
Log.d("MainActivity_Web3Auth", e.message ?: "Something went wrong")
178180
}
179181
}
180182
}
@@ -234,7 +236,12 @@ Future<void> initPlatformState() async {
234236
);
235237
// focus-end
236238
237-
await Web3AuthFlutter.initialize();
239+
try {
240+
// Restores the session if one exists. Throws when no active session is present.
241+
await Web3AuthFlutter.initialize();
242+
} catch (e) {
243+
log(e.toString());
244+
}
238245
}
239246
```
240247

@@ -278,55 +285,30 @@ Read more about initializing the Flutter SDK [here](/embedded-wallets/sdk/flutte
278285

279286
### React Native
280287

281-
```tsx
282-
const web3auth = new Web3Auth(WebBrowser, SecureStore, {
283-
clientId,
284-
network: OPENLOGIN_NETWORK.SAPPHIRE_MAINNET, // SAPPHIRE_MAINNET or SAPPHIRE_DEVNET
285-
loginConfig: {
286-
// focus-start
287-
jwt: {
288-
verifier: 'YOUR_JWT_VERIFIER_NAME', // Please create a verifier on the developer dashboard and pass the name here
289-
typeOfLogin: 'jwt',
290-
},
291-
// focus-end
292-
},
293-
})
294-
```
295-
296288
```tsx
297289
import auth from '@react-native-firebase/auth'
298290
import { GoogleSignin } from '@react-native-google-signin/google-signin'
291+
import { AUTH_CONNECTION, useWeb3AuthConnect } from '@web3auth/react-native-sdk'
299292

300-
async function signInWithFirebase() {
301-
try {
302-
GoogleSignin.configure({
303-
webClientId: '461819774167-5iv443bdf5a6pnr2drt4tubaph270obl.apps.googleusercontent.com',
304-
})
305-
// Check if your device supports Google Play
306-
await GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true })
307-
// Get the user's ID token
308-
const { idToken } = await GoogleSignin.signIn()
309-
// Create a Google credential with the token
310-
const googleCredential = auth.GoogleAuthProvider.credential(idToken)
293+
const { connectTo } = useWeb3AuthConnect()
311294

312-
// Sign-in the user with the credential
313-
const res = await auth().signInWithCredential(googleCredential)
295+
async function signInWithFirebase() {
296+
GoogleSignin.configure({ webClientId: 'YOUR_GOOGLE_WEB_CLIENT_ID' })
297+
await GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true })
298+
const { data } = await GoogleSignin.signIn()
314299

315-
const idToken = await res.user.getIdToken(true)
300+
const googleCredential = auth.GoogleAuthProvider.credential(data?.idToken ?? null)
301+
const { user } = await auth().signInWithCredential(googleCredential)
302+
const idToken = await user.getIdToken(true)
316303

317-
// focus-start
318-
await web3auth.login({
319-
redirectUrl: resolvedRedirectUrl,
320-
mfaLevel: 'default', // Pass on the MFA level of your choice: default, optional, mandatory, none
321-
loginProvider: 'jwt',
322-
extraLoginOptions: {
323-
id_token: idToken,
324-
verifierIdField: 'sub', // same as your JWT Verifier ID on the dashboard
325-
},
326-
})
327-
// focus-end
328-
} catch (error) {
329-
console.error(error)
330-
}
304+
// focus-start
305+
await connectTo({
306+
authConnection: AUTH_CONNECTION.CUSTOM,
307+
authConnectionId: 'YOUR_FIREBASE_CONNECTION_ID', // Connection ID from the dashboard
308+
idToken, // no browser opens when you pass an idToken
309+
})
310+
// focus-end
331311
}
332312
```
313+
314+
Read more about [custom authentication in the React Native SDK](/embedded-wallets/sdk/react-native/advanced/custom-authentication#bring-your-own-jwt-idtoken).

‎embedded-wallets/authentication/id-token.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When making a backend request from the frontend, the client must include this ID
2222

2323
## ID token format
2424

25-
Embedded Wallets (previously Web3Auth) issues tokens as ES256-signed JWTs containing various identity claims about the user.
25+
Embedded Wallets issues tokens as ES256-signed JWTs containing various identity claims about the user.
2626

2727
A sample decoded token is shown below:
2828

0 commit comments

Comments
 (0)