Use nhost.storage.getPresignedUrl to get a presigned URL of a file. To get a presigned URL the user must have permission to select the file in the storage.files table.

const { presignedUrl, error } = await nhost.storage.getPresignedUrl({
  fileId: '<File-ID>'
})

if (error) {
  throw error
}

console.log('url: ', presignedUrl.url)
console.log('expiration: ', presignedUrl.expiration)

Parameters


params required StorageGetPresignedUrlParams

PropertyTypeRequiredNotes
params.fileIdstring✔️
params.blurnumberImage blur, between 0 and 100
params.qualitynumberImage quality, between 1 and 100, 100 being the best quality
params.heightnumberImage height, in pixels
params.widthnumberImage width, in pixels
params.headersRecord<string, string>