useStorageSignedUrlWithOptions
useStorageSignedUrlWithOptions(
bucket,path,options?):UseQueryResult<null|string,Error>
Hook to create a signed URL with full options including image transformations
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
bucket | string | The storage bucket name |
path | null | string | The file path (or null to disable) |
options? | SignedUrlOptions | Signed URL options including expiration and transforms |
Returns
Section titled “Returns”UseQueryResult<null | string, Error>
Example
Section titled “Example”function SecureThumbnail({ path }: { path: string }) { const { data: url } = useStorageSignedUrlWithOptions('images', path, { expiresIn: 3600, transform: { width: 400, height: 300, format: 'webp', quality: 85, fit: 'cover' } });
return <img src={url || ''} alt="Secure Thumbnail" />;}