Add license validation to a Angular library

We are building a Angular library and distributing reusable components through packages using ng-packagr( We further wish to validate users based on license key for which we are using What I was able to achieve is- I am able to generate packages using ng-packagr and able to generate and validate license key. However I am stuck with where to hook license validation because the user would already have our package code and all he has to do is run npm install and import our package.

Any help would be appreciated.