Use isomorphic fetch
Since fetch is stable in the current LTS version of Node, I don't see any good reason for using node-fetch or any other solution than the web standard.
👋 Hi from Notion's API team! Thanks @huv1k @sv2dev for bumping this issue, looks like it's been open for a while. I don't have much context on this yet, though it looks like you have merge conflicts. I recently added a test that relies on us overriding the fetch passed to the Client constructor so we may need to restructure that if we go this route. Beyond that, I'll check with some folks internally to get caught up on our stance re: isomorphic fetch and see if I can get you an update here!
Hey @ksinder, thanks for picking this up. I resolved the conflicts and fixed the test.
Getting rid of the node-fetch dependency seems great, but I think ideally we still want to allow passing a fetch constructor argument into the Client to support everyone's individual use-case, instead of only supporting isomorphic fetch. Is there any way to reference a common static type for fetch to get rid of the node-fetch dependency without regressing the customizability?
Okay, I reverted the typings and client parameter related stuff. Now we should be able to use a different fetch implementation like node-fetch, and the Web API fetch is used by default.
Amazing, thank you so much for the clean change and making all those changes, and for your patience! This looks good to me and worth shipping as part of our next version release.