Production-ready file uploadsin 3 files, ~50 lines
Stop fighting with AWS SDKs and presigned URLs. Pushduck gives you type-safe, framework-agnostic file uploads that work everywhere—from Next.js to Remix, Cloudflare to AWS.
// Works with





import { createUploadConfig } from 'pushduck/server';
const { s3 } = createUploadConfig()
.provider("aws", {
bucket: process.env.AWS_BUCKET_NAME!,
region: process.env.AWS_REGION!,
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
})
.build();
const router = s3.createRouter({
imageUpload: s3.image().maxFileSize('5MB'),
});
export const { GET, POST } = router.handlers;
export type AppRouter = typeof router;
Cloudflare R2Technical Overview
// Key features and architectural decisions
16+ Framework Support
Universal handlers work with any web framework and edge runtime - from Next.js to Hono, Express to Expo to Cloudflare Workers
5+ Storage Providers
AWS S3, Cloudflare R2, DigitalOcean Spaces, Google Cloud, MinIO, Wasabi, Backblaze - switch anytime
Type-Safe APIs
Full TypeScript support with intelligent autocomplete and compile-time validation
CLI Setup
Interactive CLI guides you through setup. Get from zero to uploads in minutes
Advanced Schema Validation
Built-in file type, size, and custom validation with detailed error messages
Production Ready
Presigned URLs, chunked uploads, progress tracking, retry logic, and error handling
Framework Support
// Universal adapter works everywhere






+ Any custom HTTP server, edge runtime, or serverless function
Storage Providers
// S3-compatible storage, swap anytime
AWS S3
Industry standard with global reach

Cloudflare R2
Zero egress fees, global edge
DigitalOcean Spaces
Simple, predictable pricing
Google Cloud Storage
AI-ready with advanced features
MinIO
Self-hosted S3 compatibility

Wasabi
Hot cloud storage, predictable pricing

Backblaze B2
Affordable cloud storage

Linode Object Storage
Simple, scalable object storage
Any S3-Compatible
Works with any S3-compatible API
+ Any other S3-compatible storage service
File Type Validation
// Built-in MIME type checking & custom rules
Images
JPEG, PNG, WebP with automatic optimization
Profile pics, galleries, thumbnails
Videos
MP4, WebM, AVI with size and duration limits
Course content, demos, clips
Documents
PDF, DOCX, XLSX with virus scanning
Contracts, reports, spreadsheets
Any File Type
Custom validation rules for any format
3D models, audio, archives
Key Benefits
// What makes Pushduck different
Zero vendor lock-in
Switch storage providers or frameworks without rewriting code
Production-ready security
Presigned URLs, file validation, size limits, and CORS handling
Developer experience first
CLI setup, TypeScript intellisense, detailed error messages
Performance optimized
Direct uploads, chunked transfers, progress tracking, automatic retries
Setup Steps
npx @pushduck/cli@latest init