Appearance
Linking additional accounts
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.
To prompt a user to link an account, use the respective method from the usePrivy
hook:
linkApple
to link an Apple accountlinkDiscord
to link a Discord accountlinkEmail
to link an emaillinkFarcaster
to link a Farcaster accountlinkGithub
to link a Github accountlinkGoogle
to link a Google accountlinkInstagram
to link a Instagram accountlinkLinkedin
to link a LinkedIn accountlinkPasskey
to link a passkey accountlinkPhone
to link a phone numberlinkSpotify
to link a Spotify accountlinkTiktok
to link a TikTok accountlinkTwitter
to link a Twitter accountlinkWallet
to link a wallet
INFO
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.
Invoking these methods will open the Privy modal and guide the user through linking the desired account.
![Sample prompt to link an email](/assets/link-email.D3Su2XhR.png)
Below is an example button for prompting a user to link an email to their account:
tsx
import {usePrivy} from '@privy-io/react-auth';
function Page() {
const {ready, authenticated, user, linkEmail} = usePrivy();
// You may replace this hook with any of the other `link-` hooks to
// link a different account type.
return (
<button onClick={linkEmail} disabled={!ready || !authenticated || !!user.email}>
Link your email
</button>
);
}