useStorageTransformUrl
useStorageTransformUrl(
bucket,path,transform):string|null
Hook to get a public URL for an image with transformations applied
Only works for image files (JPEG, PNG, WebP, GIF, AVIF, etc.)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
bucket | string | The storage bucket name |
path | null | string | The file path (or null to disable) |
transform | TransformOptions | Transformation options (width, height, format, quality, fit) |
Returns
Section titled “Returns”string | null
Example
Section titled “Example”function ImageThumbnail({ path }: { path: string }) { const url = useStorageTransformUrl('images', path, { width: 300, height: 200, format: 'webp', quality: 85, fit: 'cover' });
return <img src={url || ''} alt="Thumbnail" />;}