triggerdotdev / trigger.dev

Trigger.dev is the open source background jobs platform for TypeScript.

Home Page:https://trigger.dev/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: V3 - Add a `getEnvVars` function

nahtnam opened this issue · comments

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like to see

A function that a user can define called getEnvVars in the config. This function would be run on deploy (with process.env.NODE_ENV === 'production' and dev. Whatever the function returns is used as env vars for that deployment

Example function:

async function getEnvVars() {
  if (process.env.NODE_ENV === 'development') {
    return process.env // i use direnv to load env vars, this would expose those to trigger
  }
  
  const vars = await infisicalSDK.getEnvVars() // fake function, can be any third party service
  return vars
}

Describe alternate solutions

N/A

Additional information

https://discord.com/channels/1066956501299777596/1222172315152945283/1234572031803265166