Privy allows you to import a single user into your Privy app. To import a user, pass their linked accounts (wallet, email, etc.) as part of the import request. You can also create a wallet during import with wallet pregeneration.
When an imported user logs in, all of their imported accounts will be included in their user object. If the imported user has a pregenerated embedded wallet, that wallet will be available to the user upon sign in.
Use the PrivyClient’s importUser method to import a single user into your Privy app.
An array including all of the user’s linked accounts. These objects are in the same shape as the
linked accounts returned by getUser. For
each linked account, you must specify the type and must not include a verifiedAt timestamp.
Field
Type
Description
type
'apple_oauth'
N/A
email
string
Email address associated with the user’s Apple account.
subject
number
ID of user from Apple’s user API.
Field
Type
Description
type
'custom_auth'
N/A
API: custom_user_id SDK: customUserId
string
ID of user from custom auth provider.
Field
Type
Description
type
'discord_oauth'
N/A
subject
string
ID of user from Discord user API response.
email
string
Email of user from Discord user API response
username
string
Username of user from Discord user API response. Include the 4-digit discriminator prefixed by ’#’.
Wallet address of the user from Farcaster user API response. Note that this is the Farcaster wallet address, and not the Privy embedded wallet address.
username
string
(Optional) Username of user from Farcaster user API response. Do not include the ’@’.
API: display_name SDK: displayName
string
(Optional) Display name of user from Farcaster user API response.
bio
string
(Optional) Bio of user from Farcaster user API response.
API: profile_picture_url SDK: profilePictureUrl
string
(Optional) Profile picture URL of the user from Farcaster user API response. Must be a valid image URL.
API: homepage_url SDK: homepageUrl
string
(Optional) Profile URL of the user from Farcaster user API response.
(See Farcaster docs. Note that the Privy import interface differs slightly from the Farcaster public interface in order to maintain consistency with other Privy LinkedAccount types.)
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false. If
createEthereumSmartWallet is true, you must also explicitly set createEthereumWallet to
true as well.
An array including all of the user’s linked accounts. These objects are in the same shape as the
linked accounts returned by getUser. For
each linked account, you must specify the type and must not include a verifiedAt timestamp.
Field
Type
Description
type
'apple_oauth'
N/A
email
string
Email address associated with the user’s Apple account.
subject
number
ID of user from Apple’s user API.
Field
Type
Description
type
'custom_auth'
N/A
API: custom_user_id SDK: customUserId
string
ID of user from custom auth provider.
Field
Type
Description
type
'discord_oauth'
N/A
subject
string
ID of user from Discord user API response.
email
string
Email of user from Discord user API response
username
string
Username of user from Discord user API response. Include the 4-digit discriminator prefixed by ’#’.
Wallet address of the user from Farcaster user API response. Note that this is the Farcaster wallet address, and not the Privy embedded wallet address.
username
string
(Optional) Username of user from Farcaster user API response. Do not include the ’@’.
API: display_name SDK: displayName
string
(Optional) Display name of user from Farcaster user API response.
bio
string
(Optional) Bio of user from Farcaster user API response.
API: profile_picture_url SDK: profilePictureUrl
string
(Optional) Profile picture URL of the user from Farcaster user API response. Must be a valid image URL.
API: homepage_url SDK: homepageUrl
string
(Optional) Profile URL of the user from Farcaster user API response.
(See Farcaster docs. Note that the Privy import interface differs slightly from the Farcaster public interface in order to maintain consistency with other Privy LinkedAccount types.)
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false. If
createEthereumSmartWallet is true, you must also explicitly set createEthereumWallet to
true as well.
An array including all of the user’s linked accounts. These objects are in the same shape as the
linked accounts returned by getUser. For
each linked account, you must specify the type and must not include a verifiedAt timestamp.
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false. If
createEthereumSmartWallet is true, you must also explicitly set createEthereumWallet to
true as well.
User import endpoints have a rate limit of 240 users in total per minute. If you are being rate
limited, responses will have status code 429. We suggest you set up exponential back-offs starting
at 1 second to seamlessly recover.