Upload once, deliver everywhere

Presigned URLs for direct uploads. Automatic CDN distribution. Image optimization and video streaming built in.

Presigned URLsGlobal CDNPrivate Files
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY })
// Get presigned URL for direct upload
export async function getUploadUrl(filename: string, contentType: string) {
const { uploadUrl, fileId, cdnUrl } = await stack0.cdn.createUploadUrl({
filename,
contentType,
expiresIn: 3600, // 1 hour
})
return { uploadUrl, fileId, cdnUrl }
}
// Upload from server
export async function uploadFile(file: Buffer, filename: string) {
const { cdnUrl } = await stack0.cdn.upload({
file,
filename,
folder: 'uploads',
visibility: 'public',
})
return cdnUrl
}
// Upload from URL
export async function uploadFromUrl(sourceUrl: string) {
const { cdnUrl } = await stack0.cdn.uploadFromUrl({
url: sourceUrl,
folder: 'imports',
})
return cdnUrl
}

Features

What's included

Presigned URLs

Generate temporary upload URLs. Upload directly from browser without server processing.

CDN Delivery

Files automatically distributed to edge locations. Fast loading worldwide.

Image Transforms

Resize, crop, and optimize images on the fly via URL parameters.

Video Streaming

Automatic HLS transcoding for video. Adaptive bitrate for smooth playback.

URL Import

Import files from existing URLs. Migrate content without downloading first.

Fast Uploads

Optimized upload endpoints. Handle large files efficiently.

Why Stack0

Built for production

Presigned uploads

Upload directly from browser to CDN. No file passing through your server.

Global CDN

Files served from edge locations worldwide. Fast loading everywhere.

Image optimization

Automatic WebP conversion, resize, and quality optimization on delivery.

Video streaming

HLS adaptive streaming for video files. Works on any device.

Private files

Signed URLs for access control. Keep sensitive files secure.

Simple pricing

$0.25/GB storage, $0.25/GB bandwidth. No requests charges or hidden fees.

Applications

Common implementations

User Avatars

Let users upload profile pictures. Automatic resize and optimization.

Product Images

E-commerce product galleries with automatic thumbnails and zoom versions.

Document Storage

PDFs, spreadsheets, and documents with optional signed URLs for privacy.

Video Content

User-generated video with automatic transcoding and streaming.

FAQ

Frequently asked questions

Stack0 CDN accepts any file type. Common uses include images (JPEG, PNG, WebP, GIF), videos (MP4, MOV, WebM), documents (PDF, DOCX), and application assets. There are no restrictions on file extensions.

Presigned URLs allow browser uploads directly to CDN without passing through your server. Request a URL from our API, then use it client-side to upload files. The URL expires after the configured time for security.

The default maximum file size is 100MB per file. For larger files up to 5GB, use multipart uploads. Enterprise plans support even larger files with custom limits.

Yes. Set visibility to 'private' when uploading, then generate signed URLs with expiration times to grant temporary access. Private files are not publicly accessible without a valid signed URL.

Storage is billed at $0.25 per GB stored per month. Bandwidth is billed separately at $0.25 per GB transferred. There are no per-request fees for uploads or downloads.

Ready to build?

Plans start at $5/month.

Get Started