emptyBucket()

Removes all objects inside a single bucket.

const { data, error } = await supabase
.storage
.emptyBucket('avatars')

Parameters

  • idrequiredstring

    The unique identifier of the bucket you would like to empty.

Notes

  • Policy permissions required:
    • buckets permissions: select
    • objects permissions: select and delete

Examples

Empty bucket

const { data, error } = await supabase
.storage
.emptyBucket('avatars')