From d24e0b24762a74c6cb19b5d0f1b920e70f8c4e28 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 08:39:15 +0000 Subject: [PATCH 1/2] Initial plan From c77c85da8b8081365c2ff5326c12727815c63521 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 08:53:19 +0000 Subject: [PATCH 2/2] Implement VITE_STABILITY_API_KEY environment variable support Co-authored-by: williamli <179761+williamli@users.noreply.github.com> --- packages/stablestudio-plugin-stability/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stablestudio-plugin-stability/src/index.ts b/packages/stablestudio-plugin-stability/src/index.ts index 83a7a5de..1adb8db3 100644 --- a/packages/stablestudio-plugin-stability/src/index.ts +++ b/packages/stablestudio-plugin-stability/src/index.ts @@ -23,8 +23,8 @@ const maskApiKey = (apiKey: string): string => { // Get API key from environment variables with fallback to localStorage const getApiKey = (): { value: string | undefined; fromEnv: boolean } => { - // Check for environment variables (Node.js/Electron vs Vite/React) - const envKey = process.env.STABILITY_API_KEY || (import.meta as any)?.env?.VITE_STABILITY_API_KEY; + // Check for VITE_STABILITY_API_KEY environment variable + const envKey = (import.meta as any)?.env?.VITE_STABILITY_API_KEY; if (envKey) { return { value: envKey, fromEnv: true }; @@ -568,7 +568,7 @@ export const createPlugin = StableStudio.createPlugin<{ ? { type: "string", title: "API key", - description: "API key is set via environment variable (STABILITY_API_KEY or VITE_STABILITY_API_KEY)", + description: "API key is set via environment variable (VITE_STABILITY_API_KEY)", value: maskApiKey(apiKeyValue!), required: true, placeholder: undefined,