elixir-toniq / vapor

Runtime configuration system for Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to deal with dependencies that rely on System environment variables?

Francesco-Lanciana opened this issue · comments

I'm currently using the Goth library which on start relies on a system environment variable having been set. From my understanding mix is responsible for starting dependencies before the main application starts, which is where we use Vapor to load in environment variables.

Is there any way to deal with this situation nicely? i.e. use vapor to load environment variables before the application is started?
I'm also curious to know, in general should library authors not be using System.get_env? Is this more a case of a poorly thought out library or is it just a limitation of Vapor?

I'm not sure there is a way.

In your case, according to the readme, Goth allows you to a config module with an init callback, which should work with vapor.