Skip to main content
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.
A user’s Privy account and any associated embedded wallets become permanently inaccessible if the user loses their only login method. Social OAuth providers (Twitter, Discord, etc.) can suspend or permanently delete accounts without notice — neither the app developer nor Privy can re-link a new authentication method on a user’s behalf.Apps that hold onchain assets should prompt users to link at least one durable backup method (email, phone number, or passkey) in addition to social login.
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:
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 inBelow 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.
({user: User, linkMethod: string, linkedAccount: linkedAccount}) => void
Optional callback to run after a user successfully links an account.
(error: string) => void
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. For headless wallet linking with useLinkWithSiwe or useLinkWithSiws, see the whitelabel user management documentation.

Linking additional OAuth accounts

The linkOAuth method allows your app to link additional OAuth providers that are not natively supported by Privy. For built-in providers like Google or Twitter, use the dedicated methods (e.g., linkGoogle, linkTwitter).

Parameters

The linkOAuth method accepts an object with the following fields:
string
required
The additional OAuth provider to link, in the format 'custom:<provider-name>' (e.g., 'custom:twitch').

Linking passkeys

The linkPasskey method accepts an optional object with the following fields:

Parameters

string
An optional display name to associate with the passkey. This name is shown to the user in their password manager (e.g. Google Password Manager, iCloud Keychain) when selecting which passkey to use for authentication. If not provided, the passkey defaults to your app name configured in the Privy Dashboard.

Linking custom JWT accounts

If your app uses an external JWT-based authentication provider, use the useLinkJwtAccount hook to link a custom JWT account to an already-authenticated Privy user. Unlike the methods above, this hook is headless: you provide the JWT yourself and Privy verifies it on the server.

Parameters

string
required
The JWT issued by your external authentication provider to link to the user’s account.

State

The state property tracks the current state of the JWT linking flow:

Callbacks

You can optionally pass onSuccess and onError callbacks into useLinkJwtAccount:
Custom JWT authentication must be enabled in your Privy Dashboard before using this hook. See the JWT-based authentication setup docs for instructions.