Skip to main content
When a signed-in user adds a credential — another email, phone, social account, or wallet — that already belongs to a different account, a conflict arises. The React SDK detected this inside the auth-flow modal and rendered every screen (account-exists, merge, per-field conflicts, wallet-already-used) automatically. The JavaScript SDK surfaces the same cases as typed errors and hands the UI to you.

What the React SDK did automatically

The widget pushed a built-in view for each conflict case. None of this was code you wrote — it happened inside the modal after a linking attempt. Merge completion and closing the modal happened automatically once the user confirmed.

What you own now

There is no modal and no automatic routing. The verification/linking call throws a typed error, and you branch on it to decide which UI to show.

Errors you now own

The linking calls (verifyOTP, the social verification flow, connectAndVerifyWithWalletProvider / verifyWalletAccount) throw one of these when the credential belongs to someone else:
mergeUserAccounts() persists the merged session internally and returns the merged user — you don’t re-authenticate afterward. Call it with no arguments when there are no conflicts, or with one resolution per conflicting field.

Completing the merge

Once the user has confirmed (and resolved any per-field conflicts), complete the merge. In React, useMergeUserAccounts() is a mutation whose resolved data is the merged user.
The full walkthrough — building the confirm dialog, the per-field conflict picker, and the wallet-already-used state — is in the Building UI guides.

See also

Last modified on July 23, 2026