spotify-web-api-node
spotify-web-api-node copied to clipboard
Is there any interest in converting this library to using `fetch`?
Hi all! Love the library and have been using it a bunch for a personal project. I tried to use it with Cloudflare Workers and, weirdly, Superagent does not seem to work in that runtime. One thing lead to another and I started converting it to using Node's built in fetch
(tho should be polyfillable in Node versions < 18). Is there any interest in this library becoming dependency
free?
The one breaking change in doing this that I would recommend is that this library exposes the underlying response headers
as an object and I think it should return Node's builtin in Headers
object as objects are case sensitive and headers, by definition, are not.
This could squash #490
I love that people are invested in this! I have opened up PR #492 that accomplishes the goal of replacing superagent
while keeping API compatibility with the existing library (and it's well maintained test suite). It's in @thelinmichael's court now to decide what they want to do with this library.
In the meantime, I think I might take my fork, renamespace it to spotify-web-api-fetch
and start updating it to meet my code standards (proper Typescript support, vitest, etc.)
I love that people are invested in this! I have opened up PR #492 that accomplishes the goal of replacing
superagent
while keeping API compatibility with the existing library (and it's well maintained test suite). It's in @thelinmichael's court now to decide what they want to do with this library.In the meantime, I think I might take my fork, renamespace it to
spotify-web-api-fetch
and start updating it to meet my code standards (proper Typescript support, vitest, etc.)
Any update on this? There are a couple more things this library would benefit from. Like for example I can't find how to use etags
@EduardsE so, I got through updating it and using it AND THEN Spotify released an official Typescript SDK without any dependencies. Sadly, all the arguments to the methods are positional instead of easy to use objects, but I would encourage you to check it out. It has middleware and the ability to provide custom fetch
methods.
https://github.com/spotify/spotify-web-api-ts-sdk
@eligundry thanks for the quick reply, I'll check it out.
If you are looking to write an app with a newly written and updated SDK, take a look - https://github.com/Abdullah-Malik/spotified.
The SDK that I wrote does not have any dependencies and uses fetch to make API calls. That SDK works for both browser and Node.js environments