JavaScript: Create a signed URL

Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.

Parameters

Examples

Create Signed URL

const \{ data, error \} = await supabase
  .storage
  .from('avatars')
  .createSignedUrl('folder/avatar1.png', 60)

Create a signed URL for an asset with transformations

const \{ data \} = await supabase
  .storage
  .from('avatars')
  .createSignedUrl('folder/avatar1.png', 60, \{
    transform: \{
      width: 100,
      height: 100,
    \}
  \})

Create a signed URL which triggers the download of the asset

const \{ data \} = await supabase
  .storage
  .from('avatars')
  .createSignedUrl('folder/avatar1.png', 60, \{
    download: true,
  \})