-
Notifications
You must be signed in to change notification settings - Fork 621
[Portal] Docs: Get Users Docs #6255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { Callout } from "@doc"; | ||
| import { createMetadata, ArticleIconCard } from "@doc"; | ||
|
|
||
| export const metadata = createMetadata({ | ||
| image: { | ||
| title: "Get Users", | ||
| icon: "wallets", | ||
| }, | ||
| title: "Get Users | thirdweb", | ||
| description: "Learn how to fetch in-app wallet users for your application.", | ||
| }); | ||
|
|
||
| # Get Users | ||
|
|
||
| Once you have users connecting to your app through in-app wallets, you can fetch all users through our REST API: | ||
| ``` | ||
| https://in-app-wallet.thirdweb.com/api/v1/users | ||
| ``` | ||
|
|
||
| ## Headers | ||
|
|
||
| You need to include the following headers: | ||
|
|
||
| - `Content-Type`: Must be set to `application/json` | ||
| - `x-secret-key`: Your secret key for authentication | ||
| - `x-ecosystem-id` (optional): Your ecosystem ID | ||
| - `x-ecosystem-partner-id` (optional): Your ecosystem partner ID | ||
|
|
||
| ## Example curl Command | ||
|
|
||
| Here's an example curl command to pregenerate a thirdweb wallet for the user `[email protected]`: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example description refers to pregenerating wallets, but this endpoint is for fetching users. The text should be updated to: "Here's an example curl command to fetch users:" Spotted by Graphite Reviewer |
||
|
|
||
| ```bash | ||
| curl -X POST 'https://in-app-wallet.thirdweb.com/api/v1/users?offset=200&limit=100' \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The HTTP method should be curl -X GET 'https://in-app-wallet.thirdweb.com/api/v1/users?offset=200&limit=100'Spotted by Graphite Reviewer |
||
| -H 'x-secret-key: YOUR_SECRET_KEY' \ | ||
| -H 'Content-Type: application/json' | ||
| ``` | ||
|
|
||
| Limit defaults to 100 users per request. | ||
|
|
||
| <Callout variant='info' title='Getting ecosystem users'> | ||
| For ecosystem wallets, the secret key have to be from the same account as the ecosystem owner. | ||
| </Callout> | ||
|
|
||
|
|
||
| ## Response Format | ||
|
|
||
| A successful API call returns an array of user objects in the following format: | ||
|
|
||
| ```json | ||
| [ | ||
| { | ||
| "userId": "9841a5de-b4a6-44b3-ad14-c4b8745782ca", | ||
| "walletAddress": "0x933F5BC72634c55b3643A6Aa0cD5b65ca4915d39", | ||
| "createdAt": "2024-11-05T00:55:25.142Z", | ||
| "authProvider": "google", | ||
| "authDetails": { | ||
| "id": "107302390467834615186", | ||
| "name": "Richard Hendricks", | ||
| "type": "google", | ||
| "email": "[email protected]", | ||
| "picture": "https://lh3.googleusercontent.com/a/ACg8ocKC1D6ezzzaZxxUk4qtK_HCwVwpNamVopazXwklGBwuuHeSf_c=s96-c", | ||
| "givenName": "Richard", | ||
| "emailVerified": true | ||
| }, | ||
| "email": "[email protected]", | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ You need to include the following headers: | |
| Here's an example curl command to pregenerate a thirdweb wallet for the user `[email protected]`: | ||
|
|
||
| ```bash | ||
| curl -X POST 'https://embedded-wallet.thirdweb.com/api/v1/pregenerate' \ | ||
| curl -X POST 'https://in-app-wallet.thirdweb.com/api/v1/pregenerate' \ | ||
| -H 'x-ecosystem-id: ecosystem.example-eco-123' \ | ||
| -H 'x-ecosystem-partner-id: 1415d24e-c7b0-4fce-846e-740841ef2c32' \ | ||
| -H 'x-secret-key: 9f8e7d6c5b4a3f2e1d0c9b8a7ffge434b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7' \ | ||
|
|
@@ -127,4 +127,4 @@ Pre-generating is independent and doesn't change the user's experience. | |
|
|
||
| Your users can continue to login as per usual. When they do, they will be assigned the pregenerated wallet. | ||
|
|
||
| For more information on signing in, see [Sign In](/connect/wallet/sign-in-methods/configure). | ||
| For more information on signing in, see [Sign In](/connect/wallet/sign-in-methods/configure). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, we should probably add how to get a single user here