@vetaui/storage-kit
v0.1.2
Published
Veta storage kit — provider-agnostic file uploads + media library UI (S3 / R2 / Vercel Blob / Supabase / Firebase / UploadThing / mock).
Maintainers
Readme
@vetaui/storage-kit
Provider-agnostic file storage for Next.js — uploads, signed URLs, lists, deletes — plus drop-in UI for uploaders, image galleries, and a media library page.
Install
pnpm add @vetaui/storage-kit @vetaui/foundations @vetaui/atoms @vetaui/molecules
# Optional — only for the provider you choose:
pnpm add @vercel/blob # Vercel Blob
pnpm add @aws-sdk/client-s3 @aws-sdk/s3-request-presigner # S3 / R2 / MinIOConfigure once
// app/veta.config.ts
import { configureVeta } from "@vetaui/foundations/runtime";
import { vercelBlobStorageStrategy } from "@vetaui/storage-kit/strategies";
configureVeta({
storage: vercelBlobStorageStrategy({
token: process.env.BLOB_READ_WRITE_TOKEN,
}),
});Use anywhere
import {
FileUploader,
ImageGallery,
listFiles,
removeFile,
} from "@vetaui/storage-kit";
export default async function Page() {
const { files } = await listFiles({ prefix: "products" });
return (
<>
<FileUploader
accept="image/*"
maxSize={5 * 1024 * 1024}
prefix="products"
/>
<ImageGallery
files={files}
onRemove={async (f) => {
await removeFile(f.key);
}}
/>
</>
);
}Drop-in screen
import { MediaLibraryPage } from "@vetaui/storage-kit/screens";
export default function AdminMediaPage() {
return <MediaLibraryPage prefix="brand-assets" maxSize={10 * 1024 * 1024} />;
}Public imports to use in client apps
import {
FileUploader,
ImageGallery,
listFiles,
uploadFile,
} from "@vetaui/storage-kit";
import { MediaLibraryPage } from "@vetaui/storage-kit/screens";
import {
mockStorageStrategy,
s3StorageStrategy,
} from "@vetaui/storage-kit/strategies";Avoid importing from src/*; the package only guarantees the root,
/screens, and /strategies entry points.
Adapters
| Adapter | Upload | Signed URLs | List | Remove | Progress |
| ------------------------------------- | ------ | ----------- | ---- | ------ | -------- |
| vercelBlobStorageStrategy | ✓ | — (public) | ✓ | ✓ | — |
| s3StorageStrategy (S3 / R2 / MinIO) | ✓ | ✓ | ✓ | ✓ | — |
| mockStorageStrategy | ✓ | ✓ | ✓ | ✓ | ✓ |
Custom adapter? Implement StorageStrategy from @vetaui/storage-kit/strategies — only upload is required.
