Javascript Reference v2.0

Empty a bucket

Removes all objects inside a single bucket.

  • RLS policy permissions required:
    • buckets table permissions: select
    • objects table permissions: select and delete
  • Refer to the Storage guide on how access control works
Parameters
    id
    REQUIRED
    string

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


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