Skip to main content
Live. This area is documented as current, user-reliable behavior.

Goal

Avoid routing large user files through your own application server.

Prerequisites

  • A backend route that can safely create signed upload URLs
  • A browser File object

Workflow

1
Your backend calls assets.signedUploadUrl with bucket, key, visibility, expiresIn, and maxBytes.
2
Your frontend uploads the File to the returned URL with the returned HTTP method.
3
StackShift validates the token, stores the file, and returns asset metadata.

Server creates the upload URL

const upload = await stackshift.assets.signedUploadUrl({
  bucket: 'avatars',
  key: 'users/user_123.png',
  visibility: 'public',
  expiresIn: '10m',
  maxBytes: 5_000_000,
})

Browser uploads the file

await fetch(upload.url, {
  method: upload.method,
  body: file,
  headers: { 'Content-Type': file.type },
})

Expected result

The browser uploads directly to StackShift Assets without receiving API credentials.

Assets SDK quick start

Install a StackShift SDK and upload files from Node/TypeScript, NestJS, Python, or Go.

Private assets and signed URLs

Keep files private by default and generate short-lived URLs only when a user should download them.

Upload UX and DAM

Use resumable upload sessions, progress-aware browser uploads, tags, folders, search, bulk actions, and usage summaries.