Login works fine prior to adding this flag. I’m using the latest React Embedded Wallet SDK.
Wondering what my issue might be here. Please let me know if there’s any other information I can provide.
Thanks — this looks like an error (pregenerated-wallet / useSFAKey) rather than a feature question. I pulled the details you already gave and put them into a short support summary, then added targeted troubleshooting and next steps.
Support summary (what you’ve provided)
SDK Details: MetaMask Embedded Wallets (Web3Auth)
SDK Version: “latest React Embedded Wallet SDK” (please provide exact package versions — see request below)
Init snippet: (you included the Web3AuthProvider wrapper with web3AuthOptions.useSFAKey = true)
Screenshot: you attached a console error screenshot
Why this commonly fails
Pregeneration with useSFAKey requires backend/server-side coordination. If the backend endpoint or server-side pregeneration steps are not implemented or reachable, login will break when useSFAKey is enabled. (The login flow expects pregenerated SFA data to be available.)
The Web3Auth project/dashboard must have pregeneration / SFA enabled for your clientId and for the verifiers you use.
Network or CORS failures when calling your backend (or Web3Auth endpoints) will surface as the error you showed.
SDK mismatch: useSFAKey requires compatible @web3auth / embedded-wallet SDK versions. If any package is out of date or mismatched, the flag may trigger unsupported code paths.
Immediate troubleshooting steps (try these first)
Confirm backend integration:
Do you have the backend pregeneration endpoint implemented per the docs (Step 2: Create a backend API)? If not, disable useSFAKey until the backend is in place.
In the browser devtools → Network tab, watch for requests during login. Look for failed requests to your backend or to Web3Auth endpoints.
Check Web3Auth dashboard:
Verify your clientId is correct and that pregeneration / SFA is enabled in the Web3Auth dashboard for that project.
Confirm the verifier(s) you use support SFA on the Sapphire network.
Confirm network + environment:
You’re using SAPPHIRE_DEVNET (correct for dev). Ensure no other network value is unintentionally set.
Verify package versions / compatibility:
Provide exact package versions for: @metamask/embedded-wallet-sdk (or the React wrapper package you use), @web3auth/core (or modal/wagmi packages), and any Web3Auth-related packages.
If any are not latest/compatible, upgrade per the docs.
Capture more logs:
Please share the full console error text/stack (not just screenshot) and any failed Network request responses (response body + status). That often shows the specific missing data/403/500.
What I recommend you try next
If you don’t yet have the backend implemented, remove/disable useSFAKey locally and implement the backend pregeneration flow per the docs. The login working prior to enabling the flag is expected — leave it off until backend is ready.
If you already have a backend, confirm it returns the SFA payload and that the client calls it during login (check Network tab). Fix any CORS/401/500 issues.
Confirm your clientId in the code matches the project in the Web3Auth dashboard and that pregeneration is enabled.
Check/upgrade the following packages and share exact versions so I can spot mismatches: @metamask/embedded-wallet-sdk (or embedded wallet React package), @web3auth/core (or @web3auth/modal / @web3auth/react if used).
What I need from you (only if you want me to keep troubleshooting)
Exact package versions from your package.json for the embedded-wallet SDK and all @web3auth packages.
Full console error text / stack trace (copy-paste) and any relevant failed Network responses (endpoint URL, status code, response body). The screenshot is helpful, but the text + network data is usually what reveals the cause.
If you already implemented a backend: the backend endpoint code (or paste the part that constructs/returns the SFA/pregeneration response) and the network request details from the browser when login runs.
If you prefer, start by confirming the package versions and whether you have the backend endpoint implemented — I’ll point out the next precise checks after that. I’m happy to walk through the backend sample code with you if you want.
Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. MetaMask Developer Office Hours
The docs you link me to have no mention of any sample code or any backend integration. This is where I’m very confused. Are there any other resources that describe this process?
@shana That’s what it linked to yes. The bot mentions there’s some backend flow. I don’t see any reference to that.
I want to create an experience where a user can invite someone by email on the frontend. This will pregen a wallet for that user such that when they login by that email the first time they will get that pregenned wallet.
The only thing I see the docs mentioning is to add the useSFAKey flag. I’ve tried that in the react sdk and that’s where I’m getting my error.