You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update fetching user details endpoint for ecosystems (#4918)
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on enhancing the `getUser` functionality in the `thirdweb` SDK by adding support for querying user details via an external wallet address and ecosystem identifiers.
### Detailed summary
- Added support for querying user details using `externalWalletAddress` in `getUser`.
- Updated documentation for `getUser` to include `externalWalletAddress` as a query parameter.
- Modified examples in the documentation to demonstrate querying with `externalWalletAddress`.
- Updated user detail query parameters in documentation to reflect new options.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
You can query user details using one of the following parameters:
87
+
You can specify the query parameter `queryBy` to query by different user identifiers:
88
+
89
+
-`queryBy`: The parameter to query by. Can be one of `walletAddress`, `email`, `phone`, `externalWalletAddress`, or `id`.
90
+
91
+
You can then specify the value to query by, matching the queryBy parameter:
74
92
75
-
-`walletAddress`: The user's wallet address
93
+
-`walletAddress`: The user's wallet address that thirdweb has generated for them
76
94
-`email`: The user's email address
77
95
-`phone`: The user's phone number
78
-
-`id`: The user's ID
96
+
-`externalWalletAddress`: The user's wallet address that used to login via SIWE
97
+
-`id`: The user's ID (for custom auth)
79
98
80
99
### Authentication
81
100
82
-
You need to include your ThirdWeb Client Secret in the Authorization header.
101
+
You need to include your ThirdWeb Client Secret in the Authorization header.
102
+
103
+
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.
83
104
84
105
### Example curl Command
85
106
86
-
Here's an example curl command to fetch user details:
107
+
Here's an example curl command to fetch user details by email:
108
+
109
+
```bash
110
+
curl -X GET 'https://embedded-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details?queryBy=email&email=user@example.com' \
111
+
-H 'x-secret-key: YOUR_THIRD_WEB_CLIENT_SECRET'
112
+
```
113
+
114
+
Here's an example curl command to fetch user details by address:
87
115
88
116
```bash
89
117
curl -X GET 'https://embedded-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details?queryBy=walletAddress&walletAddress=0x123456789abcdef' \
In both examples, replace `YOUR_THIRD_WEB_CLIENT_SECRET` with your actual ThirdWeb Client Secret.
131
+
132
+
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.
0 commit comments