Fork me on GitHub

Hi guys, I'm looking for a way to do OAuth2 authentication and HTTP requests with nbb. What would you say is the most straightforward way to do this? I'm currently thinking about wrapping axios and axios-oauth-client, but I would like to know if there isn't a better way.


There isn't an nbb-specific way to do it, so in this case, do whatever works best on Node.js. Perhaps someone in this channel has experience with that


Hmm @roseneck I see that sitefox, a web "framework" compatible with nbb, does have some oauth stuff: and it mentions the library


Thanks a lot, I'll check it out! 🙂


By the way, thanks so much for creating these awesome tools.

❤️ 1

You might find that the oauth server has a nodejs library eg auth0 does


Otherwise yeah passport or axios are good


just wanna say: nbb is great! I needed to use the source-map JS package in a script and nbb let me whip it up in no time with the help of Clojure's core library. Very impressive work!

❤️ 1

I remember trying to use lumo for similar type of stuff years ago and doing anything other than running a single file was a huge pain, installing it was a pain, just a lot of rough edges. a lot of thought and work has gone into bb and nbb to allow a whole slew of use cases that were previously unavailable to the clojure ecosystem. 👏:skin-tone-2:

🙇 1

Thanks @lilactown - never get tired of hearing this =)

gratitude 1

What I'm also excited about is that nbb will not only work on Node.js but also on bun and bun has great FFI support, which again will open up new possibilities


yeah bun seems super cool


huh I didn't realize bun could run react


for some reason I thought it was missing some Nodejs compat stuff


@lilactown Note that when you do bun nbb ... it won't run bun, but still Node.js due to the shebang in the nbb startup .js script. I've requested in the bun discord if this could be changed and they are considering it but right now you'll need a run.mjs wrapper which calls loadFile from the nbb package


hmm interesting. is that a bun problem or a nbb problem?


it's similar to other CLIs you invoke in bun, they did this on purpose because the Node.js compatibility isn't fully mature yet


we could have bb, nbb and bbb 😄


I can't find any info on how bun is funded


I would prefer nbb to just run on bun and maintain just one codebase. Currently you can do it the way it's documented above

💯 1

bun is very early days and experimental, it's probably better to wait for them to fix the Node.js compatibility, it's one of their priorities


idk how this guy was able to work on this for year(s). very curious if he's received funding or bootstrapped. I see he's a thiel fellow. makes me wonder where he intends to take the project w.r.t. funding in the future, e.g. go the VC route like deno did.


would probably change how I interacted with the project if I knew he had a corporate backer vs. VC vs. OSS community funding 🙂


@lilactown He was teasing on Twitter that some important new will come in the near future


So who knows


How should I include clojurescript dependencies in an nbb project? Is there a guide?


I see a discussion in the README about classpath but that doesn't actually address how to specify the libs (like in lein deps)


@sirwobin It depends which dependency. If you use git deps then you can use them directly like so:

nbb --classpath $(clojure -Spath)
but nbb can't currently read dependencies from .jar files. However, there is a workaround for that here: There is a PR to improve this, but still need to look at this


Also note that not all CLJS deps are compatible with nbb so you'll likely run into something, which you're welcome to report


I'll have a look. Thanks again!


@borkdude does the cherry project enable js to cljs interop?


ie a JS program can call the API of the exposed ES module?


I see it has its own channel ... I'll repost there