diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index fe59f6d20..da4fc6d98 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -29,7 +29,6 @@ import { Sources } from '$lib/sdk/sources'; import { building } from '$app/environment'; export function getApiEndpoint(): string { - if (building) return 'https://cloud.appwrite.io/v1'; if (VARS.APPWRITE_ENDPOINT) return VARS.APPWRITE_ENDPOINT; return globalThis?.location?.origin + '/v1'; } @@ -37,10 +36,12 @@ export function getApiEndpoint(): string { const endpoint = getApiEndpoint(); const clientConsole = new Client(); -clientConsole.setEndpoint(endpoint).setProject('console'); - const clientProject = new Client(); -clientProject.setEndpoint(endpoint).setMode('admin'); + +if (!building) { + clientConsole.setEndpoint(endpoint).setProject('console'); + clientProject.setEndpoint(endpoint).setMode('admin'); +} const sdkForProject = { client: clientProject,