Another option is to allow setting a configuration endpoint.
See: https://webcache.googleusercontent.com/search?q=cache:FYxNdVA2V7MJ:https://michal.muskala.eu/2017/07/30/configuring-elixir-libraries.html+&cd=5&hl=en&ct=clnk&gl=uk
config :libelection,
init: {SomeApp, :some_function}
Then in the app:
defmodule SomeApp do
def some_function(conf) do
{:ok, env} = Confex.fetch_env(:some_app, :libelection)
{:ok, Keyword.merge(opts, env)}
end
end
This is similar to how Phoenix and Ecto provide dynamic configuration without depending to a lib.
Originally posted by @zorbash in #6 (comment)