Skip to main content

Installation

@repo/storage is a workspace package. Three entry points are available:

// Client components and utilities
import { FileInput, Image, ClientFileManager } from '@repo/storage'

// Server-side file management
import { ServerFileManager, FilesRepository } from '@repo/storage/server'

// Database schema
import { createFilesTable } from '@repo/storage/database'

Environment Variables

S3_ACCESS_KEY_ID=your_access_key
S3_SECRET_ACCESS_KEY=your_secret_key
PRIVATE_S3_ENDPOINT=http://localhost:9000
BODY_SIZE_LIMIT=100M
VariableDescription
S3_ACCESS_KEY_IDS3 access key
S3_SECRET_ACCESS_KEYS3 secret key
PRIVATE_S3_ENDPOINTS3 endpoint URL (server-side)
BODY_SIZE_LIMITMax upload size for SvelteKit

For public file serving, also set PUBLIC_S3_ENDPOINT in your public env.