Skip to content

feat: support injecting globals for supporting platforms that do not have whatwg fetch as globals (e.g. Node.js)#43

Open
n1ru4l wants to merge 1 commit intomhart:masterfrom
n1ru4l:feat-inject-globals
Open

feat: support injecting globals for supporting platforms that do not have whatwg fetch as globals (e.g. Node.js)#43
n1ru4l wants to merge 1 commit intomhart:masterfrom
n1ru4l:feat-inject-globals

Conversation

@n1ru4l
Copy link
Copy Markdown

@n1ru4l n1ru4l commented Nov 29, 2022

I came across this library while noticing that @aws-sdk/s3-client does not work on Cloudflare Workers. (aws/aws-sdk-js-v3#3104)

I am writing isomorphic code that should work both on Cloudflare Worker runtimes and Node.js runtimes.
Currently, this library only supports Node.js by polyfilling globals, which is a practice I would love to avoid.

Instead, this PR adds new parameters for passing fetch, Request, Headers, crypto, and TextEncoder implementations to the AwsClient and AwsV4Signer constructors.


Related Links:

Closes #22
PR in which I use @aws-sdk/s3-client (but want to move to aws4fetch) 😇

@n1ru4l
Copy link
Copy Markdown
Author

n1ru4l commented Jan 9, 2023

hey @mhart, just wanted to ask again if you are planning to consider this.

@qwerzl
Copy link
Copy Markdown

qwerzl commented Jan 6, 2025

Hi @mhart, any updates on this PR? It will also fix #61.

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 this pull request may close these issues.

Node.js support?

2 participants