Linking accounts to users
Developers can use Privy to prompt users to link additional accounts (such as a wallet or Discord profile) at any point in their user journey, not just during login.
This is key to Privy’s progressive onboarding: improving conversion and UX by requiring users to complete onboarding steps (e.g. connecting an account) only when necessary.
The React SDK supports linking all supported account types via our modal-guided link methods.
To prompt a user to link an account, use the respective method from the useLinkAccount
hook:
Method | Description | User Experience |
---|---|---|
linkEmail | Links email address | Opens modal |
linkPhone | Links phone number | Opens modal |
linkWallet | Links external wallet | Opens modal |
linkGoogle | Links Google account | Direct redirect |
linkApple | Links Apple account | Direct redirect |
linkTwitter | Links Twitter account | Direct redirect |
linkDiscord | Links Discord account | Direct redirect |
linkGithub | Links Github account | Direct redirect |
linkLinkedIn | Links LinkedIn account | Direct redirect |
linkTikTok | Links TikTok account | Direct redirect |
linkSpotify | Links Spotify account | Direct redirect |
linkInstagram | Links Instagram account | Direct redirect |
linkTelegram | Links Telegram account | Direct redirect |
linkFarcaster | Links Farcaster account | Displays QR code |
linkPasskey | Links passkey | Opens modal |
Users are only permitted to link a single account for a given account type, except for wallets and passkeys. Concretely, a user may link at most one email address, but can link as many wallets and passkeys as they’d like.
Sample prompt to link a user's email after they have logged in
Below is an example button for prompting a user to link an email to their account:
Callbacks
You can optionally register an onSuccess
or onError
callback on the useLinkAccount
hook.
Optional callback to run after a user successfully links an account.
Optional callback to run after there is an error during account linkage.
Looking for whitelabel link
methods? Our useLoginWith<AccountType>
hooks allow will link an account to a user, provided that the user is already logged in whenever the authentication flow is completed.
Was this page helpful?