I’d like to use Cloudflare R2 for file storage instead of AWS S3. R2 is S3-compatible, so I expected to be able to plug R2’s credentials (Access Key ID and Secret Access Key) into the AWS integration in WeWeb.
The catch is that R2 uses a different endpoint (https://<ACCOUNT_ID>.r2.cloudflarestorage.com) and region (auto), and I don’t see a way to set a custom endpoint in the integration settings.
Does the AWS S3 integration support a custom endpoint URL?
Has anyone gotten R2 working for uploads and downloads in a WeWeb project?
I’m building a project where I’m using the R2 storage. So it’s possible
I’m using custom javascript to upload the files there though. The Cloudflare R2 integration should be coming soon I believe.
Indeed, we have an open ticket to enable R2 storage without custom JS. The current ETA is 3 weeks.
Does that work for you in terms of timing @Heshamrashwan? If not, like JP said I think AI might be able to help you implement it with custom js in the meantime.
Until the native R2 option lands, the pattern that keeps the R2 keys out of the browser is a presigned URL:
A backend function (Xano, a Supabase edge function or a Cloudflare Worker) uses the AWS S3 SDK pointed at https://<account_id>.r2.cloudflarestorage.com with region auto, creates a presigned PUT URL for the object key and returns it.
The WeWeb workflow sends the file with a plain fetch PUT to that URL.
Two things that usually trip people up: the bucket needs a CORS rule that allows PUT (and the Content-Type header) from your WeWeb domain, and the Content-Type you sign has to match the one you send. For downloads you can either serve the bucket through a custom domain or generate presigned GET URLs the same way.