I haven't been able to get either working:
const s3Client = new S3Client({
endpoint: 'https://my-account-id.r2.cloudflarestorage.com',
credentials: secrets.r2Credentials,
})
await s3Client.send(
new PutObjectCommand({
Bucket: 'my-bucket,
Key: 'test',
Body: JSON.stringify({hello: 'world'}),
}),
)
^ This fails with a 500 const r2Client = new AwsClient({
...secrets.r2Credentials,
})
fetch(
await r2Client.sign(
'https://my-account-id.r2.cloudflarestorage.com/' +
'?Key=test&Bucket=my-bucket',
{
method: 'put',
body: JSON.stringify({ hello: 'world' }),
},
),
).then((response) => console.log(response.status))
^ This fails with 401I've verified that the key has full access and even rerolled it to make sure I didn't mess up the copy paste, but still no luck.
Any ideas where I could be going wrong?