Skip to main content

deleteBucket()

Deletes an existing bucket. A bucket can't be deleted with existing objects inside it. You must first empty() the bucket.

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

Parameters

  • idrequiredstring

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

Notes

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

Examples

Delete bucket

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