Skip to main content

from.list()

Lists all the files within a bucket.

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

Parameters

  • pathoptionalundefined | string

    The folder path.

  • optionsoptionalSearchOptions

    Search options, including limit, offset, sortBy, and search.

  • parametersoptionalFetchParameters

    Fetch parameters, currently only supports signal, which is an AbortController's signal

Notes

  • Policy permissions required:
    • buckets permissions: none
    • objects permissions: select

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'
})