File storage
Public uploads such as avatars on Vercel Blob or Cloudflare R2.The storage slice puts public files on Vercel Blob or Cloudflare R2. No surface requires it, so it is asked for by name:
On the Better Auth provider it is where avatars go. On Supabase, avatars stay in Supabase Storage and the slice is there for your own uploads.
putImage accepts PNG, JPEG, WebP and GIF, checked by the file's content, up to 5 MB (STORAGE_MAX_IMAGE_BYTES). SVG and HTML are refused, because stored files are public. Refusals are StorageErrors with a status and a code.
- Vercel Blob: connect a Blob store in the project's Storage tab. Vercel sets BLOB_READ_WRITE_TOKEN.
- Cloudflare R2: a bucket with public access and an API token with Object Read & Write. Set R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET and R2_PUBLIC_URL.
Blob wins when both are set. With neither, uploads answer 501 and the app runs as before.
Edit this page on GitHub