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.
Account access is wallet access. If the delegated provider suspends or deletes an account, access to the wallet may be permanently lost. Account compromise at the delegated provider may also allow attackers to access the wallet. Privy recommends requiring MFA with either a passkey or authenticator app to protect against these risks. Set up MFA → | Security checklist →
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.