diff --git a/apps/portal/src/app/connect/sidebar.tsx b/apps/portal/src/app/connect/sidebar.tsx index b061ecd407c..f6da996e41b 100644 --- a/apps/portal/src/app/connect/sidebar.tsx +++ b/apps/portal/src/app/connect/sidebar.tsx @@ -63,6 +63,10 @@ export const sidebar: SideBar = { name: "Sign-In Methods", href: `${walletSlug}/sign-in-methods/configure`, }, + { + name: "Fetch Users", + href: `${walletSlug}/get-users`, + }, { name: "Pregenerate Wallets", href: `${walletSlug}/pregenerate-wallets`, diff --git a/apps/portal/src/app/connect/wallet/get-users/page.mdx b/apps/portal/src/app/connect/wallet/get-users/page.mdx new file mode 100644 index 00000000000..26a763c13ba --- /dev/null +++ b/apps/portal/src/app/connect/wallet/get-users/page.mdx @@ -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 `user@example.com`: + +```bash +curl -X POST 'https://in-app-wallet.thirdweb.com/api/v1/users?offset=200&limit=100' \ + -H 'x-secret-key: YOUR_SECRET_KEY' \ + -H 'Content-Type: application/json' +``` + +Limit defaults to 100 users per request. + + +For ecosystem wallets, the secret key have to be from the same account as the ecosystem owner. + + + +## 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": "richard@piedpiper.com", + "picture": "https://lh3.googleusercontent.com/a/ACg8ocKC1D6ezzzaZxxUk4qtK_HCwVwpNamVopazXwklGBwuuHeSf_c=s96-c", + "givenName": "Richard", + "emailVerified": true + }, + "email": "richard@piedpiper.com", + } +] +``` + diff --git a/apps/portal/src/app/connect/wallet/pregenerate-wallets/page.mdx b/apps/portal/src/app/connect/wallet/pregenerate-wallets/page.mdx index dc5357599e9..5e343b28f69 100644 --- a/apps/portal/src/app/connect/wallet/pregenerate-wallets/page.mdx +++ b/apps/portal/src/app/connect/wallet/pregenerate-wallets/page.mdx @@ -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 `user@example.com`: ```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). \ No newline at end of file +For more information on signing in, see [Sign In](/connect/wallet/sign-in-methods/configure).