Business authorization costs at least $5000, which is difficult for ordinary people to afford
Business authorization costs at least $5000, which is difficult for ordinary people to afford

import S3 from 'aws-sdk/clients/s3.js'; from my understanding.region: 'auto' and even more the `endpoint: https://${ACCOUNT_ID}.r2.cloudflarestorage.com\ partsus-east-1 as aliases to auto but for completeness, it's best to use autoendpoint is necessary, right? Without it I had an error telling me the account was wrong, or something of the sort.would/should I use the S3 API for that?Yeah
import S3 from 'aws-sdk/clients/s3.js';region: 'auto'https://${ACCOUNT_ID}.r2.cloudflarestorage.com\us-east-1autoautoendpointimport {S3Client} from "@aws-sdk/client-s3"
import {GetObjectCommand} from "@aws-sdk/client-s3"
const ACCOUNT_ID = 'x'
const ACCESS_KEY_ID = 'x'
const SECRET_ACCESS_KEY = 'x'
const S3 = new S3Client({
region: "auto",
endpoint: `https://${ACCOUNT_ID}.r2.cloudflarestorage.com`,
credentials: {
accessKeyId: ACCESS_KEY_ID,
secretAccessKey: SECRET_ACCESS_KEY,
}
});
console.log(
await S3.send(new GetObjectCommand({
Bucket: "sdk-example",
Key: "ferriswasm.png"
}))
)