Craft CMS module composer dependancy After some research surrounding this I can't seem to fix this issue. So for a project I made a simple module with some variables that simply has to make an OAuth1 call and return some data.

The provider of the website advised me to use :

https://github.com/thephpleague/oauth1-client

So in my module I initialised another composer.json and required the package above. It gets correctly installed to the vendor map in my module. However whenever I call the new OAuth() or new OAuth1() it can't be found.

I've tried adding it while using the packagepath in the top of my module.php as well as my moduleVariable.php but to no avail. I was wondering if I'm doing something wrong? Or forgetting something? What's the best way to add composer libraries to your own custom module?

Best regards!
The easiest way around this is to include the required library in your main-project composer.json and let it handle it rather than your modules composer.json. 

The alternative is to require your module properly in your main composer file as you do with plugins and install it via path which kinda breaks the idea of it