thirdweb 5.61.0-nightly-27375af91b86eb21d251a99dec57e0a6470511ca-20241004000320 → 5.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/contract/deployment/utils/create-2-factory.js +53 -46
- package/dist/cjs/contract/deployment/utils/create-2-factory.js.map +1 -1
- package/dist/cjs/event/actions/get-events.js +4 -4
- package/dist/cjs/event/actions/get-events.js.map +1 -1
- package/dist/cjs/exports/react.js +4 -2
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +3 -1
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/exports/wallets.js.map +1 -1
- package/dist/cjs/exports/wallets.native.js.map +1 -1
- package/dist/cjs/react/native/hooks/wallets/useLinkProfile.js +92 -0
- package/dist/cjs/react/native/hooks/wallets/useLinkProfile.js.map +1 -0
- package/dist/cjs/react/native/hooks/wallets/useProfiles.js +3 -4
- package/dist/cjs/react/native/hooks/wallets/useProfiles.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useLinkProfile.js +91 -0
- package/dist/cjs/react/web/hooks/wallets/useLinkProfile.js.map +1 -0
- package/dist/cjs/react/web/hooks/wallets/useProfiles.js +3 -4
- package/dist/cjs/react/web/hooks/wallets/useProfiles.js.map +1 -1
- package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js +2 -1
- package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/users/getUser.js +11 -8
- package/dist/cjs/wallets/in-app/core/users/getUser.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +1 -0
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js +23 -16
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/contract/deployment/utils/create-2-factory.js +53 -46
- package/dist/esm/contract/deployment/utils/create-2-factory.js.map +1 -1
- package/dist/esm/event/actions/get-events.js +4 -4
- package/dist/esm/event/actions/get-events.js.map +1 -1
- package/dist/esm/exports/react.js +1 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +1 -0
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js.map +1 -1
- package/dist/esm/react/native/hooks/wallets/useLinkProfile.js +89 -0
- package/dist/esm/react/native/hooks/wallets/useLinkProfile.js.map +1 -0
- package/dist/esm/react/native/hooks/wallets/useProfiles.js +3 -4
- package/dist/esm/react/native/hooks/wallets/useProfiles.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useLinkProfile.js +88 -0
- package/dist/esm/react/web/hooks/wallets/useLinkProfile.js.map +1 -0
- package/dist/esm/react/web/hooks/wallets/useProfiles.js +3 -4
- package/dist/esm/react/web/hooks/wallets/useProfiles.js.map +1 -1
- package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js +2 -1
- package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/in-app/core/users/getUser.js +11 -8
- package/dist/esm/wallets/in-app/core/users/getUser.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +1 -0
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/index.js +23 -16
- package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/types/contract/deployment/utils/create-2-factory.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +1 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +1 -0
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +1 -0
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/wallets.native.d.ts +1 -0
- package/dist/types/exports/wallets.native.d.ts.map +1 -1
- package/dist/types/react/native/hooks/wallets/useLinkProfile.d.ts +74 -0
- package/dist/types/react/native/hooks/wallets/useLinkProfile.d.ts.map +1 -0
- package/dist/types/react/native/hooks/wallets/useProfiles.d.ts +3 -4
- package/dist/types/react/native/hooks/wallets/useProfiles.d.ts.map +1 -1
- package/dist/types/react/web/hooks/wallets/useLinkProfile.d.ts +73 -0
- package/dist/types/react/web/hooks/wallets/useLinkProfile.d.ts.map +1 -0
- package/dist/types/react/web/hooks/wallets/useProfiles.d.ts +3 -4
- package/dist/types/react/web/hooks/wallets/useProfiles.d.ts.map +1 -1
- package/dist/types/utils/any-evm/zksync/isZkSyncChain.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/users/getUser.d.ts +8 -6
- package/dist/types/wallets/in-app/core/users/getUser.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +23 -16
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/contract/deployment/utils/create-2-factory.ts +70 -57
- package/src/event/actions/get-events.ts +4 -4
- package/src/exports/react.native.ts +1 -0
- package/src/exports/react.ts +1 -0
- package/src/exports/wallets.native.ts +1 -0
- package/src/exports/wallets.ts +1 -0
- package/src/extensions/thirdweb/write/publish.test.ts +20 -12
- package/src/react/native/hooks/wallets/useLinkProfile.ts +92 -0
- package/src/react/native/hooks/wallets/useProfiles.ts +3 -4
- package/src/react/web/hooks/wallets/useLinkProfile.ts +91 -0
- package/src/react/web/hooks/wallets/useProfiles.ts +3 -4
- package/src/utils/any-evm/zksync/isZkSyncChain.ts +2 -1
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/types.ts +1 -0
- package/src/wallets/in-app/core/users/getUser.ts +14 -7
- package/src/wallets/in-app/native/native-connector.ts +1 -0
- package/src/wallets/in-app/web/lib/auth/index.ts +23 -16
- package/src/wallets/in-app/web/lib/web-connector.ts +1 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
import { useMutation } from "@tanstack/react-query";
|
2
|
+
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
3
|
+
import type { AuthArgsType } from "../../../../wallets/in-app/core/authentication/types.js";
|
4
|
+
import type { Ecosystem } from "../../../../wallets/in-app/core/wallet/types.js";
|
5
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
6
|
+
import { useAdminWallet } from "../../../core/hooks/wallets/useAdminWallet.js";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Links a web2 or web3 profile to the connected in-app or ecosystem account.
|
10
|
+
*
|
11
|
+
* **When a profile is linked to the account, that profile can then be used to sign into the same account.**
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
*
|
15
|
+
* ### Linking a social profile
|
16
|
+
*
|
17
|
+
* ```jsx
|
18
|
+
* import { useLinkProfile } from "thirdweb/react";
|
19
|
+
*
|
20
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
21
|
+
*
|
22
|
+
* const onClick = () => {
|
23
|
+
* linkProfile({
|
24
|
+
* client,
|
25
|
+
* strategy: "discord", // or "google", "x", "telegram", etc
|
26
|
+
* });
|
27
|
+
* };
|
28
|
+
* ```
|
29
|
+
*
|
30
|
+
* ### Linking an email
|
31
|
+
*
|
32
|
+
* ```jsx
|
33
|
+
* import { useLinkProfile } from "thirdweb/react";
|
34
|
+
* import { preAuthenticate } from "thirdweb/wallets";
|
35
|
+
*
|
36
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
37
|
+
*
|
38
|
+
* // send a verification email first
|
39
|
+
* const sendEmail = async () => {
|
40
|
+
* const email = await preAuthenticate({
|
41
|
+
* client,
|
42
|
+
* strategy: "email",
|
43
|
+
* email: "john.doe@example.com",
|
44
|
+
* });
|
45
|
+
* };
|
46
|
+
*
|
47
|
+
* // then link the profile with the verification code
|
48
|
+
* const onClick = (code: string) => {
|
49
|
+
* linkProfile({
|
50
|
+
* client,
|
51
|
+
* strategy: "email",
|
52
|
+
* email: "john.doe@example.com",
|
53
|
+
* verificationCode: code,
|
54
|
+
* });
|
55
|
+
* };
|
56
|
+
* ```
|
57
|
+
*
|
58
|
+
* The same process can be used for phone and email, simply swap out the `strategy` parameter.
|
59
|
+
*
|
60
|
+
* ### Linking a wallet
|
61
|
+
*
|
62
|
+
* ```jsx
|
63
|
+
* import { useLinkProfile } from "thirdweb/react";
|
64
|
+
*
|
65
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
66
|
+
*
|
67
|
+
* const onClick = () => {
|
68
|
+
* linkProfile({
|
69
|
+
* client,
|
70
|
+
* strategy: "wallet",
|
71
|
+
* wallet: createWallet("io.metamask"), // autocompletion for 400+ wallet ids
|
72
|
+
* chain: sepolia, // any chain works, needed for SIWE signature
|
73
|
+
* });
|
74
|
+
* };
|
75
|
+
* ```
|
76
|
+
*
|
77
|
+
* @wallet
|
78
|
+
*/
|
79
|
+
export function useLinkProfile() {
|
80
|
+
const wallet = useAdminWallet();
|
81
|
+
return useMutation({
|
82
|
+
mutationKey: ["profiles"],
|
83
|
+
mutationFn: async (options: Omit<AuthArgsType, "ecosystem">) => {
|
84
|
+
const ecosystem: Ecosystem | undefined =
|
85
|
+
wallet && isEcosystemWallet(wallet)
|
86
|
+
? { id: wallet.id, partnerId: wallet.getConfig()?.partnerId }
|
87
|
+
: undefined;
|
88
|
+
const optionsWithEcosystem = { ...options, ecosystem } as AuthArgsType;
|
89
|
+
return linkProfile(optionsWithEcosystem);
|
90
|
+
},
|
91
|
+
});
|
92
|
+
}
|
@@ -7,11 +7,10 @@ import { getProfiles } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
|
7
7
|
import { useAdminWallet } from "../../../core/hooks/wallets/useAdminWallet.js";
|
8
8
|
|
9
9
|
/**
|
10
|
-
* Retrieves all linked profiles of the connected in-app or ecosystem
|
10
|
+
* Retrieves all linked profiles of the connected in-app or ecosystem account.
|
11
11
|
*
|
12
|
-
* @returns A React Query result containing the linked profiles for the connected in-app
|
13
|
-
*
|
14
|
-
* @note This hook will only run if the connected wallet supports multi-auth (in-app wallets).
|
12
|
+
* @returns A React Query result containing the linked profiles for the connected in-app account.
|
13
|
+
* @note This hook will only run if the connected wallet supports account linking.
|
15
14
|
*
|
16
15
|
* @example
|
17
16
|
* ```jsx
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { useMutation } from "@tanstack/react-query";
|
2
|
+
import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
|
3
|
+
import type { AuthArgsType } from "../../../../wallets/in-app/core/authentication/types.js";
|
4
|
+
import type { Ecosystem } from "../../../../wallets/in-app/core/wallet/types.js";
|
5
|
+
import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
6
|
+
import { useAdminWallet } from "../../../core/hooks/wallets/useAdminWallet.js";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Links a web2 or web3 profile to the connected in-app or ecosystem account.
|
10
|
+
* **When a profile is linked to the account, that profile can then be used to sign into the same account.**
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
*
|
14
|
+
* ### Linking a social profile
|
15
|
+
*
|
16
|
+
* ```jsx
|
17
|
+
* import { useLinkProfile } from "thirdweb/react";
|
18
|
+
*
|
19
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
20
|
+
*
|
21
|
+
* const onClick = () => {
|
22
|
+
* linkProfile({
|
23
|
+
* client,
|
24
|
+
* strategy: "discord", // or "google", "x", "telegram", etc
|
25
|
+
* });
|
26
|
+
* };
|
27
|
+
* ```
|
28
|
+
*
|
29
|
+
* ### Linking an email
|
30
|
+
*
|
31
|
+
* ```jsx
|
32
|
+
* import { useLinkProfile } from "thirdweb/react";
|
33
|
+
* import { preAuthenticate } from "thirdweb/wallets";
|
34
|
+
*
|
35
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
36
|
+
*
|
37
|
+
* // send a verification email first
|
38
|
+
* const sendEmail = async () => {
|
39
|
+
* const email = await preAuthenticate({
|
40
|
+
* client,
|
41
|
+
* strategy: "email",
|
42
|
+
* email: "john.doe@example.com",
|
43
|
+
* });
|
44
|
+
* };
|
45
|
+
*
|
46
|
+
* // then link the profile with the verification code
|
47
|
+
* const onClick = (code: string) => {
|
48
|
+
* linkProfile({
|
49
|
+
* client,
|
50
|
+
* strategy: "email",
|
51
|
+
* email: "john.doe@example.com",
|
52
|
+
* verificationCode: code,
|
53
|
+
* });
|
54
|
+
* };
|
55
|
+
* ```
|
56
|
+
*
|
57
|
+
* The same process can be used for phone and email, simply swap out the `strategy` parameter.
|
58
|
+
*
|
59
|
+
* ### Linking a wallet
|
60
|
+
*
|
61
|
+
* ```jsx
|
62
|
+
* import { useLinkProfile } from "thirdweb/react";
|
63
|
+
*
|
64
|
+
* const { mutate: linkProfile } = useLinkProfile();
|
65
|
+
*
|
66
|
+
* const onClick = () => {
|
67
|
+
* linkProfile({
|
68
|
+
* client,
|
69
|
+
* strategy: "wallet",
|
70
|
+
* wallet: createWallet("io.metamask"), // autocompletion for 400+ wallet ids
|
71
|
+
* chain: sepolia, // any chain works, needed for SIWE signature
|
72
|
+
* });
|
73
|
+
* };
|
74
|
+
* ```
|
75
|
+
*
|
76
|
+
* @wallet
|
77
|
+
*/
|
78
|
+
export function useLinkProfile() {
|
79
|
+
const wallet = useAdminWallet();
|
80
|
+
return useMutation({
|
81
|
+
mutationKey: ["profiles"],
|
82
|
+
mutationFn: async (options: AuthArgsType) => {
|
83
|
+
const ecosystem: Ecosystem | undefined =
|
84
|
+
wallet && isEcosystemWallet(wallet)
|
85
|
+
? { id: wallet.id, partnerId: wallet.getConfig()?.partnerId }
|
86
|
+
: undefined;
|
87
|
+
const optionsWithEcosystem = { ...options, ecosystem } as AuthArgsType;
|
88
|
+
return linkProfile(optionsWithEcosystem);
|
89
|
+
},
|
90
|
+
});
|
91
|
+
}
|
@@ -7,11 +7,10 @@ import { getProfiles } from "../../../../wallets/in-app/web/lib/auth/index.js";
|
|
7
7
|
import { useAdminWallet } from "../../../core/hooks/wallets/useAdminWallet.js";
|
8
8
|
|
9
9
|
/**
|
10
|
-
* Retrieves all linked profiles of the connected in-app or ecosystem
|
10
|
+
* Retrieves all linked profiles of the connected in-app or ecosystem account.
|
11
11
|
*
|
12
|
-
* @returns A React Query result containing the linked profiles for the connected in-app
|
13
|
-
*
|
14
|
-
* @note This hook will only run if the connected wallet supports multi-auth (in-app wallets).
|
12
|
+
* @returns A React Query result containing the linked profiles for the connected in-app account.
|
13
|
+
* @note This hook will only run if the connected wallet supports account linking.
|
15
14
|
*
|
16
15
|
* @example
|
17
16
|
* ```jsx
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.61.0
|
1
|
+
export const version = "5.61.0";
|
@@ -3,6 +3,7 @@ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
|
3
3
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
4
4
|
import type { OneOf, Prettify } from "../../../../utils/type-utils.js";
|
5
5
|
import type { Profile } from "../authentication/types.js";
|
6
|
+
import type { Ecosystem } from "../wallet/types.js";
|
6
7
|
|
7
8
|
export type GetUserResult = {
|
8
9
|
userId: string;
|
@@ -17,24 +18,23 @@ export type GetUserResult = {
|
|
17
18
|
* Gets user based on the provided query parameters.
|
18
19
|
* @note This function is only available on the server (a secret key is required in the client).
|
19
20
|
*
|
20
|
-
* @param options - The options for the
|
21
|
+
* @param options - The options for the get user function.
|
21
22
|
* @param options.client - The Thirdweb client with a secret key included.
|
22
|
-
* @param [options.walletAddress] - The wallet address to query by.
|
23
|
+
* @param [options.walletAddress] - The wallet address generated by thirdweb to query by.
|
23
24
|
* @param [options.email] - The email to query by.
|
24
25
|
* @param [options.phone] - The phone number to query by.
|
25
26
|
* @param [options.id] - The user ID to query by.
|
27
|
+
* @param [options.externalWalletAddress] - The linked external wallet address to query by.
|
26
28
|
*
|
27
|
-
* @returns
|
29
|
+
* @returns A user object or null if not found.
|
28
30
|
*
|
29
31
|
* @example
|
30
|
-
* ```ts
|
31
32
|
* import { getUser } from "thirdweb/wallets";
|
32
33
|
*
|
33
34
|
* const user = await getUser({
|
34
35
|
* client,
|
35
36
|
* walletAddress: "0x123...",
|
36
37
|
* });
|
37
|
-
* ```
|
38
38
|
*
|
39
39
|
* @wallet
|
40
40
|
*/
|
@@ -44,14 +44,18 @@ export async function getUser({
|
|
44
44
|
email,
|
45
45
|
phone,
|
46
46
|
id,
|
47
|
+
externalWalletAddress,
|
48
|
+
ecosystem,
|
47
49
|
}: Prettify<
|
48
50
|
{
|
49
51
|
client: ThirdwebClient;
|
52
|
+
ecosystem?: Ecosystem;
|
50
53
|
} & OneOf<{
|
51
54
|
walletAddress?: string;
|
52
55
|
email?: string;
|
53
56
|
phone?: string;
|
54
57
|
id?: string;
|
58
|
+
externalWalletAddress?: string;
|
55
59
|
}>
|
56
60
|
>): Promise<GetUserResult | null> {
|
57
61
|
if (!client.secretKey) {
|
@@ -76,13 +80,16 @@ export async function getUser({
|
|
76
80
|
} else if (id) {
|
77
81
|
url.searchParams.set("queryBy", "id");
|
78
82
|
url.searchParams.set("id", id);
|
83
|
+
} else if (externalWalletAddress) {
|
84
|
+
url.searchParams.set("queryBy", "externalWalletAddress");
|
85
|
+
url.searchParams.set("externalWalletAddress", externalWalletAddress);
|
79
86
|
} else {
|
80
87
|
throw new Error(
|
81
|
-
"Please provide a walletAddress, email, phone, or
|
88
|
+
"Please provide a walletAddress, email, phone, id, or externalWalletAddress to query for users.",
|
82
89
|
);
|
83
90
|
}
|
84
91
|
|
85
|
-
const clientFetch = getClientFetch(client);
|
92
|
+
const clientFetch = getClientFetch(client, ecosystem);
|
86
93
|
|
87
94
|
const res = await clientFetch(url.toString());
|
88
95
|
|
@@ -152,9 +152,9 @@ export async function authenticate(args: AuthArgsType) {
|
|
152
152
|
* @returns A promise that resolves to the authentication result.
|
153
153
|
* @example
|
154
154
|
* ```ts
|
155
|
-
* import {
|
155
|
+
* import { authenticateWithRedirect } from "thirdweb/wallets/in-app";
|
156
156
|
*
|
157
|
-
* const result = await
|
157
|
+
* const result = await authenticateWithRedirect({
|
158
158
|
* client,
|
159
159
|
* strategy: "google",
|
160
160
|
* mode: "redirect",
|
@@ -180,25 +180,21 @@ export async function authenticateWithRedirect(
|
|
180
180
|
}
|
181
181
|
|
182
182
|
/**
|
183
|
-
* Connects a new profile (authentication method) to the current user.
|
184
|
-
* The connected profile can be any valid in-app wallet including email, phone, passkey, etc.
|
185
|
-
* The inputs mirror those used when authenticating normally.
|
183
|
+
* Connects a new profile (and new authentication method) to the current user.
|
186
184
|
*
|
187
|
-
*
|
185
|
+
* Requires a connected in-app or ecosystem account.
|
188
186
|
*
|
189
|
-
*
|
187
|
+
* **When a profile is linked to the account, that profile can then be used to sign into the same account.**
|
190
188
|
*
|
191
|
-
* @param wallet - The wallet to link an additional profile to.
|
192
189
|
* @param auth - The authentications options to add the new profile.
|
193
190
|
* @returns A promise that resolves to the currently linked profiles when the connection is successful.
|
194
191
|
* @throws If the connection fails, if the profile is already linked to the account, or if the profile is already associated with another account.
|
195
192
|
*
|
196
193
|
* @example
|
197
194
|
* ```ts
|
198
|
-
*
|
195
|
+
* import { linkProfile } from "thirdweb/wallets";
|
199
196
|
*
|
200
|
-
* await
|
201
|
-
* const profiles = await linkProfile({ client, strategy: "discord" });
|
197
|
+
* await linkProfile({ client, strategy: "discord" });
|
202
198
|
* ```
|
203
199
|
* @wallet
|
204
200
|
*/
|
@@ -214,17 +210,28 @@ export async function linkProfile(args: AuthArgsType) {
|
|
214
210
|
*
|
215
211
|
* @example
|
216
212
|
* ```ts
|
217
|
-
* import {
|
218
|
-
*
|
219
|
-
* const wallet = inAppWallet();
|
220
|
-
* wallet.connect({ strategy: "google" });
|
213
|
+
* import { getProfiles } from "thirdweb/wallets";
|
221
214
|
*
|
222
215
|
* const profiles = await getProfiles({
|
223
216
|
* client,
|
224
217
|
* });
|
225
218
|
*
|
226
|
-
* console.log(profiles[0].type);
|
219
|
+
* console.log(profiles[0].type); // will be "email", "phone", "google", "discord", etc
|
227
220
|
* console.log(profiles[0].details.email);
|
221
|
+
* console.log(profiles[0].details.phone);
|
222
|
+
* ```
|
223
|
+
*
|
224
|
+
* ### Getting profiles for a ecosystem user
|
225
|
+
*
|
226
|
+
* ```ts
|
227
|
+
* import { getProfiles } from "thirdweb/wallets/in-app";
|
228
|
+
*
|
229
|
+
* const profiles = await getProfiles({
|
230
|
+
* client,
|
231
|
+
* ecosystem: {
|
232
|
+
* id: "ecosystem.your-ecosystem-id",
|
233
|
+
* },
|
234
|
+
* });
|
228
235
|
* ```
|
229
236
|
* @wallet
|
230
237
|
*/
|