diff --git a/server/src/external/infisical/initInfisical.ts b/server/src/external/infisical/initInfisical.ts index c5964d0ec..dd5cffa49 100644 --- a/server/src/external/infisical/initInfisical.ts +++ b/server/src/external/infisical/initInfisical.ts @@ -32,6 +32,7 @@ export const initInfisical = async (params?: { secretPath?: string }) => { environment, projectId, secretPath: params?.secretPath, + includeImports: true, }); // Load secrets into process.env @@ -45,6 +46,15 @@ export const initInfisical = async (params?: { secretPath?: string }) => { } } + for (const importSecrets of allSecrets?.imports ?? []) { + for (const importSecret of importSecrets.secrets) { + if (!process.env[importSecret.secretKey]) { + process.env[importSecret.secretKey] = importSecret.secretValue; + loadedCount++; + } + } + } + console.log(`✅ Infisical: loaded ${loadedCount} secrets into process.env`); } catch (error) { console.error("❌ Failed to initialize Infisical:", error);