Skip to content

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
}

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.

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.

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.

Frequently asked questions

Ready to build?

Get started in minutes.

Get Started