From 50e89cba80908fbe75ee5446ec1b06d6ff081b62 Mon Sep 17 00:00:00 2001 From: Fernando Coelho <42558330+Fgc17@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:44:30 -0300 Subject: [PATCH 1/2] Update Infisical instructions to new SDK Current documentation is using old Infisical SDK implementation. New SDK has a different name, and authenticates on a method, not in the class constructor. --- docs/deploy-environment-variables.mdx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index 3f67a5bb6a..35f7e88371 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -103,12 +103,14 @@ export default defineConfig({ build: { extensions: [ syncEnvVars(async (ctx) => { - const client = new InfisicalClient({ - clientId: process.env.INFISICAL_CLIENT_ID, - clientSecret: process.env.INFISICAL_CLIENT_SECRET, + const client = new InfisicalSDK(); + + await client.auth().universalAuth.login({ + clientId: process.env.INFISICAL_CLIENT_ID!, + clientSecret: process.env.INFISICAL_CLIENT!, }); - const secrets = await client.listSecrets({ + const { secrets } = await client.secrets().listSecrets({ environment: ctx.environment, projectId: process.env.INFISICAL_PROJECT_ID!, }); From 993b5e70121285c8105a268f9f0ef97c1180f81b Mon Sep 17 00:00:00 2001 From: Fernando Coelho <42558330+Fgc17@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:17:03 -0300 Subject: [PATCH 2/2] Fix import and client secret env --- docs/deploy-environment-variables.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index 35f7e88371..5ec2c55af3 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -97,7 +97,7 @@ In this example we're using env vars from [Infisical](https://infisical.com). ```ts trigger.config.ts import { defineConfig } from "@trigger.dev/sdk/v3"; import { syncEnvVars } from "@trigger.dev/build/extensions/core"; -import { InfisicalClient } from "@infisical/sdk"; +import { InfisicalSDK } from "@infisical/sdk"; export default defineConfig({ build: { @@ -107,7 +107,7 @@ export default defineConfig({ await client.auth().universalAuth.login({ clientId: process.env.INFISICAL_CLIENT_ID!, - clientSecret: process.env.INFISICAL_CLIENT!, + clientSecret: process.env.INFISICAL_CLIENT_SECRET!, }); const { secrets } = await client.secrets().listSecrets({