Ad

Ways To Identify If My Clients Are Using The CDN Or NPM Versions Of My JS Library?

- 1 answer

I am currently in the midst of thinking of launching an open sourced version of my library on NPM. However, I'm wondering if there is a way for me to know whether the clients are using my CDN/NPM especially.

Is there anyway that this can actually be done?

Ad

Answer

I've thought about this and have come up with one idea so far:

  1. Adding a commit tag to the minified file, which allows me to see the commit hash of a version either from NPM, or from our own CDN.

Would be good to hear if anyone else has ideas!

Ad
source: stackoverflow.com
Ad