badgateway / oauth2-client

OAuth2 client for Node and browsers
https://www.npmjs.com/package/@badgateway/oauth2-client
MIT License
269 stars 31 forks source link

provide web library over cdn #122

Closed mimil closed 1 year ago

mimil commented 1 year ago

hello,

I am trying to use you libraries in a frontend, I am not an expert in nodejs, but it appears that we cannot use an npm module as is. While looking at your build scripts, a browser version can be generate. While looking on internet it appears that there is already a library with same name: https://www.jsdelivr.com/package/npm/oauth2-client-js

Can you release something? or the only way is to generate the browser version and to embed this js in my front?

Thank you, Cédric,

evert commented 1 year ago

If you for some reason can't use npm, you can still just download the NPM package manually. That file is really just a 'tgz' file (similar to a zip file, can be extracted in most operating systems).

If that file a browser/ directory exists which has the built browser files.

Or just download from github and build these files yourself.

mimil commented 1 year ago

Hi, thank you for your fast reply. Yes I did this to use the browser version that I copy/past to my webserver.

But I think is not the optimal solution, the optimal one could be to have it distributed over a CDN like https://www.jsdelivr.com/ in order to allow to include it directly into html script tags, on a given version you release. Because it seems that we cannot include direclty an NPM libraries, it is designed for nodejs, not browser.

Also providing the bit of code on how to use it in plain browser javascript would be nice.

Bu we can consider this ticket as closed, as I extract the browser version. Just take it at comments.

evert commented 1 year ago

The project is open source. If there's something that needs to change for it to work over a cdn, please make a pull request

The library certainly is designed for browsers, just not in the specific way you want. No need for sweeping statements, I'm providing a free service.

mimil commented 1 year ago

Yes no problem, I am open-source developer too. I have 2 merge requests to send to you, I will send in upcomming weeks.

On CDN things, I am no expert as I am not a JS/frontend dev. But I will have a look.

Thank you for the lib, it is working well and with a nice design understandable by non JS dev. Cédric

Le ven. 8 sept. 2023 à 18:12, Evert Pot @.***> a écrit :

The project is open source. If there's something that needs to change for it to work over a cdn, please make a pull request

The library certainly is designed for browsers, just not in the specific way you want. No need for sweeping statements, I'm providing a free service.

— Reply to this email directly, view it on GitHub https://github.com/badgateway/oauth2-client/issues/122#issuecomment-1711915877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIN3ZZ446J7P2HMSVALMATXZM7XXANCNFSM6AAAAAA4NY3A34 . You are receiving this because you modified the open/close state.Message ID: @.***>

evert commented 1 year ago

Thank you!