ServicesCloudflare R2

Cloudflare R2

Installation

Install S3 service

npm i @uplo/service-s3

Add service to Uplo

import S3Service from '@uplo/service-s3'
 
const uplo = Uplo({
  services: {
    r2: S3Service({
      isPublic: false,
      endpoint: 'Your endpoint from R2',
      bucket: 'your-bucket',
      accessKeyId: '*****',
      secretAccessKey: '*****',
 
      // If you are using Cloudflare Workers, add this:
      // requestHandler: {
      //  requestInit(_httpRequest) {
      //    return { cache: undefined };
      //  },
      // },
    }),
  },
})