veR2 - Object Versioning for Cloudflare R2

https://ver2.jbuxo.dev/

veR2 adds object versioning to an existing Cloudflare R2 bucket without changing how anything reads from it.

R2 has no native object versioning, so an overwrite or delete is permanent. veR2 keeps every version, lets you restore any of them, and tells you honestly when it can't guarantee something.

It's open source (Apache 2.0) and Phase 1 is published on npm: npm i @ver2/sdk / npm i -g @ver2/cli. It's still pre-alpha, so APIs will change.

How it works

your app ──► veR2 SDK ──► R2 bucket
                            ├── uploads/a.png         live object (same key as always)
                            ├── .ver2/o/…/<version>   immutable version bytes
                            └── .ver2/m/uploads/a.png manifest: history + in-flight op journal
readers ──────────────────► uploads/a.png   (unchanged: CDN, public URLs, presigned GETs)
  • Reads don't change: live objects stay at their keys, and veR2 is never in the read path
  • Writes go through veR2: each write keeps an immutable copy, promotes it to the live key with R2's conditional-copy guards, and journals every step so a crash can be finished or undone from evidence
  • Direct writes are caught: if something writes to R2 behind veR2's back, the next veR2 write preserves that object as an external version before replacing it
  • Only R2 credentials needed: metadata lives in the bucket itself

Usage

import { createVer2 } from "@ver2/sdk";
import { S3ObjectStore } from "@ver2/sdk/s3";

const ver2 = createVer2({ store: new S3ObjectStore({ bucket, accountId, credentials }) });

const { versionId } = await ver2.put("docs/report.pdf", bytes);
await ver2.versions.list("docs/report.pdf");
await ver2.versions.restore("docs/report.pdf", versionId);
ver2 put docs/report.pdf ./report.pdf
ver2 versions docs/report.pdf
ver2 restore docs/report.pdf <versionId>

Guarantees and limitations

veR2 guarantees what R2 lets it guarantee and documents the rest.

  • Concurrent veR2 writers to one key: serialized, losers get ConcurrencyConflict
  • A direct write racing a veR2 write: detected, never silently clobbered
  • Crash mid-operation: rolled forward/back from evidence, or flagged OperationIncomplete
  • Version integrity: SHA-256 verified on download
  • Direct deletes (outside veR2): can't be prevented or undone, since R2 ignores delete conditions
  • Hot keys: R2 allows about 1 write/s per key, so expect 429s on rapid rewrites
  • Large objects: Phase 1 buffers bodies in memory, streaming/multipart comes in Phase 2

What's next

SQL metadata stores (SQLite, Postgres, D1), a Workers driver, and enterprise features like retention, audit and policies. Check out the docs at ver2.jbuxo.dev or the repo on GitHub . Contributions welcome.

Reach Out

Wether you just want to say hi, you want to collaborate on a project, or if you're hiring I'd love to hear from you

Copyright © 2026 Jose Buxo. All rights