Image transformations for your own Cloudflare R2 bucket
Connect your Cloudflare R2 bucket to a Dreep project and your images live in R2. Users upload straight from the browser, and you request any size, WebP or AVIF variant by URL. Requires Starter or Pro.
How it fits together
- 1
Browser upload
Presigned, single-use URL
- 2
Your R2 bucket
Original stored here
- 3
Request a URL
?width=800&format=webp
- 4
Generated once
Variant written to your R2
- 5
Dreep CDN
Cached delivery
Direct browser uploads into R2
Confirmed originals land in your bucket. You do not write R2 presigning code or bucket CORS rules, and your API key stays on your server.
const dreep = new Dreep({ apiKey: process.env.DREEP_API_KEY });
const upload = await dreep.presignUpload({
filename: "listing.jpg",
contentType: "image/jpeg",
sizeBytes: 3_400_000,
});
// The browser PUTs the file to upload.uploadUrl, then:
const asset = await dreep.confirmUpload({ id: upload.id });
const medium = dreep.url(asset, { width: 800, format: "webp" });upload, err := client.PresignUpload(ctx, dreep.PresignOptions{
Filename: "listing.jpg", ContentType: "image/jpeg", SizeBytes: 3_400_000,
})
// The browser PUTs the file to upload.UploadURL, then:
asset, err := client.ConfirmUpload(ctx, upload.ID, nil)
medium := client.URL(asset.ID, &dreep.Transform{Width: 800, Format: dreep.FormatWebP})curl -X POST https://api.dreep.cloud/api/v1/upload/presign \
-H "Authorization: Bearer $DREEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"listing.jpg","contentType":"image/jpeg","sizeBytes":3400000}'
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/jpeg" --data-binary @listing.jpg
curl -X POST "https://api.dreep.cloud/api/v1/upload/$UPLOAD_ID/confirm" \
-H "Authorization: Bearer $DREEP_API_KEY"Why use it
No resize service to run
Each variant is generated on the first request, written to your bucket and served from cache after that.
A flat Dreep bill
Files in your bucket do not count against the plan's storage allowance, and Cloudflare bills R2 to you directly.
Private images stay private
Images in a Signed folder are only reachable with a time-limited link the SDK generates locally.
Frequently asked questions
Can I resize images stored in Cloudflare R2?
Yes, for files uploaded through a Dreep project connected to your R2 bucket. Request the asset's CDN URL with parameters such as width, height, fit and format, and Dreep generates the variant from the original in your bucket.
Can I connect a bucket that already has my images in it?
Only to a project that is still empty, and Dreep only knows about files uploaded through it. To bring an existing library across, use the R2 importer in the dashboard, which copies chosen objects into a Dreep project.
Where are the generated variants stored?
In your R2 bucket, alongside the originals. Delivery still goes through Dreep CDN URLs, so your bucket does not need public access.
Can I switch the bucket later?
Not for the same project. The bucket is fixed once connected. To use a different bucket, create a new project.
Connect R2 to a new project
Create a project on Starter, connect your R2 bucket before the first upload, and request your first WebP variant by URL.