Skip to content

Commit c2934ce

Browse files
committed
Refactor API host constant usage
Moved THIRDWEB_API_HOST definition to a shared constants file and updated imports in searchUsers and useEmbeddedWallets to use the centralized constant. This improves maintainability and consistency across the codebase.
1 parent 3744fdb commit c2934ce

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

apps/dashboard/src/@/components/in-app-wallet-users-content/searchUsers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import type {
44
} from "@thirdweb-dev/api";
55
import { configure, listUserWallets } from "@thirdweb-dev/api";
66
import type { WalletUser } from "thirdweb/wallets";
7+
import { THIRDWEB_API_HOST } from "@/constants/urls";
78
import type { SearchType } from "./types";
89

910
// Configure the API client to use the correct base URL
10-
const THIRDWEB_API_HOST =
11-
process.env.NEXT_PUBLIC_THIRDWEB_API_HOST || "https://api.thirdweb.com";
1211
configure({
1312
override: {
1413
baseUrl: THIRDWEB_API_HOST,

apps/dashboard/src/@/constants/urls.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
export const THIRDWEB_EWS_API_HOST =
2-
process.env.NEXT_PUBLIC_THIRDWEB_EWS_API_HOST ||
3-
"https://in-app-wallet.thirdweb.com";
1+
export const THIRDWEB_API_HOST =
2+
process.env.NEXT_PUBLIC_THIRDWEB_API_HOST || "https://api.thirdweb.com";
43

54
export const THIRDWEB_PAY_DOMAIN =
65
process.env.NEXT_PUBLIC_PAY_URL || "pay.thirdweb-dev.com";

apps/dashboard/src/@/hooks/useEmbeddedWallets.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import type {
66
import { configure, listUserWallets } from "@thirdweb-dev/api";
77
import { useActiveAccount } from "thirdweb/react";
88
import type { WalletUser } from "thirdweb/wallets";
9+
import { THIRDWEB_API_HOST } from "@/constants/urls";
910
import { embeddedWalletsKeys } from "../query-keys/cache-keys";
1011

1112
// Configure the API client to use the correct base URL
12-
const THIRDWEB_API_HOST =
13-
process.env.NEXT_PUBLIC_THIRDWEB_API_HOST || "https://api.thirdweb.com";
1413
configure({
1514
override: {
1615
baseUrl: THIRDWEB_API_HOST,

0 commit comments

Comments
 (0)