2024-04-01 21:34:52 +03:00
|
|
|
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL as string;
|
|
|
|
|
|
|
|
|
|
if (!apiBaseUrl) {
|
2024-06-13 19:17:05 +03:00
|
|
|
console.warn("apiBaseUrl environment variable was not set");
|
2024-04-01 21:34:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const environment = import.meta.env.VITE_ENVIRONMENT as string;
|
|
|
|
|
|
|
|
|
|
if (!environment) {
|
2024-06-13 19:17:05 +03:00
|
|
|
console.warn("environment environment variable was not set");
|
2024-04-01 21:34:52 +03:00
|
|
|
}
|
|
|
|
|
|
2024-04-15 11:54:12 -07:00
|
|
|
const envCredential: string | null =
|
2024-05-09 20:21:13 +03:00
|
|
|
import.meta.env.VITE_SKYVERN_API_KEY ?? null;
|
2024-04-01 21:34:52 +03:00
|
|
|
|
2024-04-15 11:54:12 -07:00
|
|
|
const artifactApiBaseUrl = import.meta.env.VITE_ARTIFACT_API_BASE_URL;
|
2024-04-01 21:34:52 +03:00
|
|
|
|
|
|
|
|
if (!artifactApiBaseUrl) {
|
2024-06-13 19:17:05 +03:00
|
|
|
console.warn("artifactApiBaseUrl environment variable was not set");
|
2024-04-01 21:34:52 +03:00
|
|
|
}
|
|
|
|
|
|
2025-01-15 02:20:00 -08:00
|
|
|
const apiPathPrefix = import.meta.env.VITE_API_PATH_PREFIX ?? "";
|
|
|
|
|
|
2025-07-07 22:30:33 -04:00
|
|
|
const lsKeys = {
|
|
|
|
|
browserSessionId: "skyvern.browserSessionId",
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-10 17:48:01 -04:00
|
|
|
const wssBaseUrl = import.meta.env.VITE_WSS_BASE_URL;
|
|
|
|
|
|
|
|
|
|
let newWssBaseUrl = wssBaseUrl;
|
|
|
|
|
try {
|
|
|
|
|
const url = new URL(wssBaseUrl);
|
|
|
|
|
if (url.pathname.startsWith("/api")) {
|
|
|
|
|
url.pathname = url.pathname.replace(/^\/api/, "");
|
|
|
|
|
}
|
|
|
|
|
newWssBaseUrl = url.toString();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
newWssBaseUrl = wssBaseUrl.replace("/api", "");
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-15 02:20:00 -08:00
|
|
|
export {
|
|
|
|
|
apiBaseUrl,
|
|
|
|
|
environment,
|
|
|
|
|
envCredential,
|
|
|
|
|
artifactApiBaseUrl,
|
|
|
|
|
apiPathPrefix,
|
2025-07-07 22:30:33 -04:00
|
|
|
lsKeys,
|
2025-07-10 17:48:01 -04:00
|
|
|
wssBaseUrl,
|
|
|
|
|
newWssBaseUrl,
|
2025-01-15 02:20:00 -08:00
|
|
|
};
|