JavaScript: List all files in a bucket (original) (raw)

Lists all the files within a bucket.

Parameters

(Optional)
The folder path.

(Optional)

(Optional)

Examples

List files in a bucket

const { data, error } = await supabase
  .storage
  .from('avatars')
  .list('folder', {
    limit: 100,
    offset: 0,
    sortBy: { column: 'name', order: 'asc' },
  })

Search files in a bucket

const { data, error } = await supabase
  .storage
  .from('avatars')
  .list('folder', {
    limit: 100,
    offset: 0,
    sortBy: { column: 'name', order: 'asc' },
    search: 'jon'
  })