The way most libraries do this is to let the user configure it using their own config.exs. The config.exs in the library is only used when developing the library.
In your library you fetch the config, if there is none set by the user you use a default.
Bitwalker made a fantastic little helper at https://gist.github.com/bitwalker/a4f73b33aea43951fe19b242d06da7b9 that lets you get a configuration from the config file, or from an environment variable, or a default, all in one call. Just save that Gist as a Config.ex in your project (Bitwalker really should make that into a library, small though it may be, he still should). Just use it like:
So that when the configuration is not explicitly set there is a sensible default (the production config).
On a more meta note, the confusion around this (and Iâve had my own share of confusion) seem to indicate that application configuration could use a more prominent section in the Elixir guides. Currently it is at the bottom of this page and doesnât cover the issue of end-user vs library applications at all: https://elixir-lang.org/getting-started/mix-otp/distributed-tasks-and-configuration.html