Open Cretezy opened 1 year ago
Good point 👍 Are you willing to open a PR? Would be great since you already made the migration somewhere else ;)
Yes can look into it!
Hey guys 👋🏼 I have made the upgrade to V3. Anyone would be able to test it on their side and with a public bucket, please?
Hey guys 👋🏼 I have made the upgrade to V3. Anyone would be able to test it on their side and with a public bucket, please?
Thanks for your PR. Please see my comments on it for some feedback
v2 will be EOL in 2023, v3 is now recommended.
AWS docs: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/migrating-to-v3.html
Cloudflare docs: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/
I just migrated one of my projects, which basically uses the same API as this one, and here are the changes I did:
aws-sdk
to@aws-sdk/client-s3
&@aws-sdk/lib-storage
inpackage.json
Use the following to upload files:
await new Upload({ client: s3, params: { Key: ..., Body: ..., ContentType: ..., Bucket: process.env.CF_BUCKET!, }, }).done();