Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any interest in converting this library to using fetch? #491

Open
eligundry opened this issue Jun 21, 2023 · 5 comments · May be fixed by #492
Open

Is there any interest in converting this library to using fetch? #491

eligundry opened this issue Jun 21, 2023 · 5 comments · May be fixed by #492

Comments

@eligundry
Copy link

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

@eligundry eligundry linked a pull request Jul 1, 2023 that will close this issue
@eligundry
Copy link
Author

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.)

@EduardsE
Copy link

EduardsE commented Sep 6, 2023

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

@eligundry
Copy link
Author

@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

@EduardsE
Copy link

EduardsE commented Sep 6, 2023

@eligundry thanks for the quick reply, I'll check it out.

@Abdullah-Malik
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants