# storage

Private file gateway: responsibilities, supported exports and extension points.

## Purpose [#purpose]

The files-sdk adapter exposes authenticated uploads, reads and deletion over Cloudflare R2. Its server plugin connects object operations to application metadata and upload intents. Node development uses the configured S3-compatible endpoint.

## Public exports [#public-exports]

| Subpath | Target |
| --- | --- |
| `.` | `./src/index.ts` |
| `./config` | `./src/config.ts` |
| `./upload-plugin` | `./src/upload-plugin.ts` |
| `./direct` | `./src/direct.ts` |
| `./direct-s3` | `./src/direct-s3.ts` |

These paths come from `packages/storage/package.json`. A `.` entry is the package root. Conditional targets distinguish platform or type resolution; consumers should import the subpath, not its source file.

## How to extend [#how-to-extend]

Extend the existing gateway/plugin so upload intent, ownership checks and metadata remain coordinated. Keep R2 credentials and storage adapters out of client imports. Exercise cleanup after an interrupted upload.

Read the [private file gateway guide](/docs/features/files) for the full flow.

## Key files [#key-files]

- [`packages/storage/package.json`](https://github.com/CarlosZiegler/doro/blob/main/packages/storage/package.json)

