> ## Documentation Index
> Fetch the complete documentation index at: https://shipfree.revoks.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage

> Cloudflare R2 upload and signed URLs.

# Storage

ShipFree includes an R2 client built on `aws4fetch` in `src/lib/storage.ts`.

## Capabilities

* Upload base64 strings or remote URLs
* Upload blobs and buffers
* Generate signed upload and download URLs
* Delete objects from public or private buckets

## Required environment variables

* `CLOUDFLARE_ACCOUNT_ID`
* `R2_ACCESS_KEY_ID`
* `R2_SECRET_ACCESS_KEY`
* `R2_BUCKET_URL`
* `R2_PUBLIC_BUCKET`
* `R2_PRIVATE_BUCKET`

## Usage

```ts theme={null}
import { storage } from '@/lib/storage'

await storage.upload({
  key: 'avatars/user-1.png',
  body: someBlob,
  bucket: 'public',
})
```

<Warning>
  Uploads will fail if bucket configuration is missing. Validate your R2 settings before enabling storage features.
</Warning>
