From ecb8825734b169ba83a67752610ec8d2fec20b87 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sat, 29 Nov 2025 16:46:56 +0530 Subject: [PATCH] client config via .env file --- src/tictactoe/providers/NakamaProvider.tsx | 6 +++++- src/vite-env.d.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tictactoe/providers/NakamaProvider.tsx b/src/tictactoe/providers/NakamaProvider.tsx index 62f2b25..9cd5524 100644 --- a/src/tictactoe/providers/NakamaProvider.tsx +++ b/src/tictactoe/providers/NakamaProvider.tsx @@ -47,7 +47,11 @@ export const NakamaContext = createContext(null!); export function NakamaProvider({ children }: { children: React.ReactNode }) { const [client] = useState( - () => new Client("defaultkey", "127.0.0.1", "7350") + () => new Client( + import.meta.env.VITE_WS_SKEY, + import.meta.env.VITE_WS_HOST, + import.meta.env.VITE_WS_PORT + ) ); const [session, setSession] = useState(null); diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index abf1348..134004e 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,7 +1,9 @@ /// interface ImportMetaEnv { - readonly VITE_WS_BASE_URL: string; + readonly VITE_WS_HOST: string; + readonly VITE_WS_PORT: string; + readonly VITE_WS_SKEY: string; } interface ImportMeta {