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

Goal

Generate optimized image URLs without exposing arbitrary transformation generation to the public internet.

Prerequisites

  • An uploaded image asset
  • A named transformation or a server route that can create signed transform URLs

Workflow

1
Create reusable presets for common shapes such as avatars, thumbnails, and product cards.
2
Use /t/{preset}/assets/{assetId}/{filename} for named transforms.
3
Use signed dynamic URLs when the dimensions must be chosen at request time.
4
Let StackShift store derived outputs by asset ID, source checksum, and transform hash.

Supported transforms

  • Resize with width and height.
  • Crop modes c_fit and c_fill.
  • Format output with f_auto, webp, avif, jpeg, and png.
  • Quality output with q_auto or explicit quality.
  • Thumbnail-style presets for square or bounded previews.

Named preset

await stackshift.assets.transformations.create('avatar', {
  width: 256,
  height: 256,
  crop: 'fill',
  format: 'webp',
  quality: 'auto',
})

const url = stackshift.assets.namedUrl(asset.id, 'avatar')

Signed dynamic transform

const url = await stackshift.assets.signedTransformUrl(asset.id, {
  width: 400,
  height: 400,
  crop: 'fill',
  format: 'auto',
  quality: 'auto',
  expiresIn: '10m',
})

Expected result

Repeated image requests reuse cached derived assets and the CDN receives stable, optimized URLs.

StackShift Assets overview

StackShift Assets is now a live media platform: storage, CDN delivery, image optimization, upload sessions, DAM, video, scanning, governance, AI metadata, and version history.

Assets SDK quick start

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