flickr / flickr-sdk

Almost certainly the best Flickr API client in the world for node and the browser
https://www.flickr.com/services/api
MIT License
131 stars 29 forks source link

Usage with WebCrypto instead of node's crypto #150

Open johtso opened 2 years ago

johtso commented 2 years ago

I'm wanting to make requests to Flickr's api in a Cloudflare Worker, but it provides WebCrypto rather than node's crypto implementation.

This turns out to be causing a real headache especially as the WebCrypto API is asynchronous.

Any pointers gratefully received!

jeremyruppel commented 2 years ago

Neat! So there are two main parts to our OAuth stuff: there's the OAuth class, which implements the OAuth signature algorithm, and the OAuth superagent plugin, which uses the OAuth class to sign the request. I would probably start out by making your own copies of both of those files and edit them to be async/use webcrypto, then use your plugin instead. Let us know how it turns out!