Retrieving In-App Wallet User Details on the Server
Using the thirdweb TypeScript SDK
You can query user details through the thirdweb SDK using a wallet address, email, phone number, or user ID. This function requires a secret key to be present on the thirdweb client and should only be used on the server.
Fetching User Details via API
To get the user details, you can make a GET
request to the following endpoint:
https://embedded-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details
Query Parameters
You can query user details using one of the following parameters:
walletAddress
: The user's wallet addressemail
: The user's email addressphone
: The user's phone numberid
: The user's ID
Authentication
You need to include your ThirdWeb Client Secret in the Authorization header.
Example curl Command
Here's an example curl command to fetch user details:
Replace YOUR_THIRD_WEB_CLIENT_SECRET
with your actual ThirdWeb Client Secret.
Response Format
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.
Remember to handle the response appropriately in your chosen programming language, including error cases and parsing the JSON response.