Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update InfisicalClient initialization

Tuan Dang34c79b08bc59
diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts
index 175328caa0..e2b52eab33 100644
--- a/backend/src/config/index.ts
+++ b/backend/src/config/index.ts
@@ -1,4 +1,8 @@
-import infisical from 'infisical-node';
+import InfisicalClient from 'infisical-node';
+
+const infisical = new InfisicalClient({
+ token: process.env.INFISICAL_TOKEN!
+});
export const getPort = async () => await infisical.get('PORT')! || 4000;
export const getInviteOnlySignup = async () => await infisical.get('INVITE_ONLY_SIGNUP')! == undefined ? false : await infisical.get('INVITE_ONLY_SIGNUP');
diff --git a/backend/src/index.ts b/backend/src/index.ts
index 877a4215dd..7aecafe9e8 100644
--- a/backend/src/index.ts
+++ b/backend/src/index.ts
@@ -79,10 +79,6 @@ import {
} from './config';
const main = async () => {
- infisical.connect({
- token: process.env.INFISICAL_TOKEN!
- });
-
TelemetryService.logTelemetryMessage();
setTransporter(await initSmtp());