Getting User Profiles
Once authenticated, you can retrieve the user profiles linked to a wallet. This allows you to access additional information about the user, such as their email address or phone number.
Regardless of platform, the response will have a json object in the following shape as some level:
Note that the email
field above will differ based on the profile type. We list the expected field below in our list of strategies.
For frontend, we provide methods to get information around the currently logged in user.
TypeScript
Get logged in user profile for in-app wallets in TypeScript
React
Get logged in user profile for in-app wallets in React
React Native
Get logged in user profile for in-app wallets in React Native
.NET
Get logged in user profile for in-app wallets in .NET
Unity
Get logged in user profile for in-app wallets in Unity
TypeScript
Get user profile for ecosystem wallets in TypeScript
React
Get user profile for ecosystem wallets in React
React Native
Get user profile for ecosystem wallets in React Native
.NET
Get user profile for ecosystem wallets in .NET
Unity
Get user profile for ecosystem wallets in Unity
From the backend, you are able to get the details of any user within your in app or ecosystem wallet.
To get the user details, you can make a GET
request to the following endpoint:
https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details
You can specify the query parameter queryBy
to query by different user identifiers:
queryBy
: The parameter to query by. Can be one ofwalletAddress
,email
,phone
,externalWalletAddress
, orid
.
You can then specify the value to query by, matching the queryBy parameter:
walletAddress
: The user's wallet address that thirdweb has generated for thememail
: The user's email addressphone
: The user's phone numberexternalWalletAddress
: The user's wallet address that used to login via SIWEid
: The user's ID (for custom auth)
You need to include your ThirdWeb Client Secret in the Authorization header.
If you are an ecosystem owner, you have to include the x-ecosystem-id
header and optionally the x-ecosystem-partner-id
header if the ecosystem is set to partners only.
Here's an example curl command to fetch user details by email:
Here's an example curl command to fetch user details by address:
Here's an example curl command to fetch the user details for an ecosystem owner:
In both examples, replace YOUR_THIRD_WEB_CLIENT_SECRET
with your actual ThirdWeb Client Secret.
Replace YOUR_ECOSYSTEM_ID
and YOUR_PARTNER_ID
with your actual ecosystem ID and partner ID respectively. The partner ID can be one you set up for yourself as the ecosystem owner.
The API returns a JSON array with the following structure for each user:
Note: The details
object in linkedAccounts
will contain different fields based on the account type. See the list of Strategies above for more information.
Remember to handle the response appropriately in your chosen programming language, including error cases and parsing the JSON response.
If you are using the thirdweb SDK, you can use the getUser
method to retrieve user details.
getUser
Get user details from your backend for thirdweb wallets in TypeScript
If you want to link additional identities to a wallet, see Linking Multiple Identities.