node-convict
node-convict copied to clipboard
Plugins
would be great if one could add custom plugins where to fetch the variables from. there is a built-in 'env' property, but it would be great if one could fetch something from somewhere else, like AWS secrets manager.
I would leave it up to the user to implement their own providers, but right now there is only the hardcoded env
functionality.
Agree as well - not necessarily broad plugin support, but some sort of "provider" infrastructure. I came here looking for ways to directly integrate S3 configuration management and AWS secrets manager, but it appears all we get is the "out of the box" functionality.
The hardcoded precedence order could be replaced with a default set of providers in a stack.
Good ideas. You are welcome to propose PR.
I had a PR for this (#273), but what I just realized is that you can leverage the convict.load() method for this by passing in a function that returns an object. I already have an SSM provider that works with my fork (https://github.com/HBKEngineering/convict-provider-awsSsm), but I'm working on modifying it to support native convict
.
You can add custom keys to your config (ie "providerPath: '/blah'" ) to do this, convict
won't mind.
Similar/Duplicate : #313