Friend, you have a very complicated problem here. Almost no Cordova plugin is only in JavaScript, they have a Java-coded part or other languages depending on each platform, in addition to needing permissions for each action.
For example in the mentioned Vibration plugin we realize that inside the SRC
folder there are several codes that must be added to the application project. Not being able to be requited from a server.
Another problem that can easily occur is the hosting of different versions of JS
files, which may cause future problems.
However ...
As Cordova is a relatively new technology that does not support everything, it is still common to find users and developers thinking about alternatives and solutions to problems like this.
I do not know how you intend to embed this plugin into your project and when it should be embedded. But I suppose you should want to use it in just one specific case. For example request the plugin only when notifications are activated or something similar.
If it's something like this, I recommend that you implement all the functions in your application, but all the functions you use and can use, so create events
in your application to trigger these functions. This way you can communicate with your web server using JavaScript requests, but issuing events. And yes, the application should be larger in size, but everything should work fine.