Skip to content

Commit 9e5d9c0

Browse files
add tracking, fix cache 404
1 parent 1c2bc57 commit 9e5d9c0

File tree

5 files changed

+40
-2
lines changed

5 files changed

+40
-2
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/analytics/send-test-tx.client.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
sepolia,
2727
} from "thirdweb/chains";
2828
import * as z from "zod";
29+
import { useTrack } from "../../../../../../../../hooks/analytics/useTrack";
2930
import type { Wallet } from "../server-wallets/wallet-table/types";
3031
import { SmartAccountCell } from "../server-wallets/wallet-table/wallet-table-ui.client";
3132

@@ -49,6 +50,7 @@ export function SendTestTransaction(props: {
4950
const queryClient = useQueryClient();
5051
const [hasSentTx, setHasSentTx] = useState(false);
5152
const router = useDashboardRouter();
53+
const trackEvent = useTrack();
5254

5355
const form = useForm<FormValues>({
5456
resolver: zodResolver(formSchema),
@@ -74,6 +76,11 @@ export function SendTestTransaction(props: {
7476
accessToken: string;
7577
chainId: number;
7678
}) => {
79+
trackEvent({
80+
category: "engine-cloud",
81+
action: "send_test_tx",
82+
});
83+
7784
const response = await engineCloudProxy({
7885
pathname: "/v1/write/transaction",
7986
method: "POST",

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/server-wallets/components/create-server-wallet.client.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Loader2, WalletIcon } from "lucide-react";
1616
import { useState } from "react";
1717
import { toast } from "sonner";
1818
import { engineCloudProxy } from "../../../../../../../../../@/actions/proxies";
19+
import { useTrack } from "../../../../../../../../../hooks/analytics/useTrack";
1920
import { initVaultClient } from "../../lib/vault.client";
2021

2122
export default function CreateServerWallet(props: {
@@ -26,6 +27,7 @@ export default function CreateServerWallet(props: {
2627
const router = useDashboardRouter();
2728
const [label, setLabel] = useState("");
2829
const [modalOpen, setModalOpen] = useState(false);
30+
const trackEvent = useTrack();
2931

3032
const createEoaMutation = useMutation({
3133
mutationFn: async ({
@@ -35,6 +37,11 @@ export default function CreateServerWallet(props: {
3537
managementAccessToken: string;
3638
label: string;
3739
}) => {
40+
trackEvent({
41+
category: "engine-cloud",
42+
action: "create_server_wallet",
43+
});
44+
3845
const vaultClient = await initVaultClient();
3946

4047
const eoa = await createEoa({
@@ -60,7 +67,7 @@ export default function CreateServerWallet(props: {
6067

6168
// no need to await this, it's not blocking
6269
engineCloudProxy({
63-
pathname: "/v1/cache/smart-account",
70+
pathname: "/cache/smart-account",
6471
method: "POST",
6572
headers: {
6673
"Content-Type": "application/json",

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/vault/components/create-vault-account.client.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { createServiceAccount } from "@thirdweb-dev/vault-sdk";
1818
import { CheckIcon, DownloadIcon, Loader2, LockIcon } from "lucide-react";
1919
import { useState } from "react";
2020
import { toast } from "sonner";
21+
import { useTrack } from "../../../../../../../../../hooks/analytics/useTrack";
2122
import {
2223
createManagementAccessToken,
2324
createWalletAccessToken,
@@ -33,11 +34,17 @@ export default function CreateVaultAccountButton(props: {
3334
const [keysConfirmed, setKeysConfirmed] = useState(false);
3435
const [keysDownloaded, setKeysDownloaded] = useState(false);
3536
const router = useDashboardRouter();
37+
const trackEvent = useTrack();
3638

3739
const initialiseProjectWithVaultMutation = useMutation({
3840
mutationFn: async () => {
3941
setModalOpen(true);
4042

43+
trackEvent({
44+
category: "engine-cloud",
45+
action: "create_vault_account",
46+
});
47+
4148
const vaultClient = await initVaultClient();
4249

4350
const serviceAccount = await createServiceAccount({

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/vault/components/list-access-tokens.client.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Loader2, LockIcon, Trash2 } from "lucide-react";
1818
import { useState } from "react";
1919
import { toast } from "sonner";
2020
import { toDateTimeLocal } from "utils/date-utils";
21+
import { useTrack } from "../../../../../../../../../hooks/analytics/useTrack";
2122
import {
2223
SERVER_WALLET_MANAGEMENT_ACCESS_TOKEN_PURPOSE,
2324
createWalletAccessToken,
@@ -32,11 +33,17 @@ export default function ListAccessTokens(props: {
3233
const [adminKey, setAdminKey] = useState("");
3334
const [deletingTokenId, setDeletingTokenId] = useState<string | null>(null);
3435
const queryClient = useQueryClient();
36+
const trackEvent = useTrack();
3537
// TODO allow passing permissions to the access token
3638
const createAccessTokenMutation = useMutation({
3739
mutationFn: async (args: { adminKey: string }) => {
3840
const vaultClient = await initVaultClient();
3941

42+
trackEvent({
43+
category: "engine-cloud",
44+
action: "create_access_token",
45+
});
46+
4047
const userAccessTokenRes = await createWalletAccessToken({
4148
project: props.project,
4249
adminKey: args.adminKey,
@@ -68,6 +75,11 @@ export default function ListAccessTokens(props: {
6875
setDeletingTokenId(args.accessTokenId);
6976
const vaultClient = await initVaultClient();
7077

78+
trackEvent({
79+
category: "engine-cloud",
80+
action: "revoke_access_token",
81+
});
82+
7183
const revokeAccessTokenRes = await revokeAccessToken({
7284
client: vaultClient,
7385
request: {

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/vault/components/rotate-admin-key.client.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from "lucide-react";
2727
import { useState } from "react";
2828
import { toast } from "sonner";
29+
import { useTrack } from "../../../../../../../../../hooks/analytics/useTrack";
2930
import {
3031
createManagementAccessToken,
3132
createWalletAccessToken,
@@ -38,10 +39,14 @@ export default function RotateAdminKeyButton(props: { project: Project }) {
3839
const [keysConfirmed, setKeysConfirmed] = useState(false);
3940
const [keysDownloaded, setKeysDownloaded] = useState(false);
4041
const router = useDashboardRouter();
42+
const trackEvent = useTrack();
4143

4244
const rotateAdminKeyMutation = useMutation({
4345
mutationFn: async () => {
44-
await new Promise((resolve) => setTimeout(resolve, 1000));
46+
trackEvent({
47+
category: "engine-cloud",
48+
action: "rotate_admin_key",
49+
});
4550

4651
const vaultClient = await initVaultClient();
4752
const rotationCode = props.project.services.find(

0 commit comments

Comments
 (0)