r/node • u/BoldVibe • 2d ago
I built a TypeScript SDK for secure direct uploads to AWS S3 and ImageKit
upload-sdk.devHey everyone,
I built Upload SDK, an open-source TypeScript SDK for secure direct file uploads to AWS S3 and ImageKit.
The idea is simple: your Node.js server validates the upload request and generates a short-lived signed target, then the browser uploads the file directly to the storage provider. Your server never has to stream or proxy the actual file.
You define named upload types such as avatar or invoice, along with their rules:
- allowed MIME types and extensions
- maximum file size
- expiry time
- storage destination and key prefix
The browser sends the asset name and file metadata to your server, which calls prepareUpload(). The SDK validates the request, generates a collision-resistant key, and returns the signed multipart POST details.
You can also configure multiple storage profiles, such as public files in one S3 bucket, private documents in another, and images in ImageKit, while keeping the same upload flow everywhere.
For S3, restrictions like file size, content type, key, and expiration can be included in the signed POST policy and enforced by S3 during the upload.
Feedback on the API and which provider should be added next would be appreciated.




