Skip to content

Commit 7668b65

Browse files
committed
feature: siwe event tracker
1 parent b8140c1 commit 7668b65

File tree

1 file changed

+13
-7
lines changed
  • packages/thirdweb/src/analytics/track

1 file changed

+13
-7
lines changed

packages/thirdweb/src/analytics/track/siwe.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import type { Ecosystem } from "src/wallets/in-app/core/wallet/types.js";
12
import type { ThirdwebClient } from "../../client/client.js";
23
import { stringify } from "../../utils/json.js";
34
import { track } from "./index.js";
45

56
type SiweEvent = {
67
client: ThirdwebClient;
8+
ecosystem?: Ecosystem;
79
walletAddress?: string;
810
walletType?: string;
911
chainId?: number;
@@ -52,12 +54,16 @@ function trackSiweEvent(
5254
type: "login:success" | "login:error";
5355
},
5456
) {
55-
track(event.client, {
56-
action: event.type,
57-
clientId: event.client.clientId,
58-
chainId: event.chainId,
59-
walletAddress: event.walletAddress,
60-
walletType: event.walletType,
61-
errorCode: stringify(event.error),
57+
track({
58+
client: event.client,
59+
ecosystem: event.ecosystem,
60+
data: {
61+
action: event.type,
62+
clientId: event.client.clientId,
63+
chainId: event.chainId,
64+
walletAddress: event.walletAddress,
65+
walletType: event.walletType,
66+
errorCode: stringify(event.error),
67+
},
6268
});
6369
}

0 commit comments

Comments
 (0)