Skip to main content
Version: v2 RC

createBucket()

Creates a new Storage bucket

const { data, error } = await supabase
.storage
.createBucket('avatars', { public: false })

Parameters

  • idrequiredstring

    A unique identifier for the bucket you are creating.

  • optionsrequiredobject

    No description provided.

      Properties
    • publicrequiredboolean

      The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private.

Notes

  • RLS policy permissions required:
    • buckets table permissions: insert
    • objects table permissions: none
  • Refer to the Storage guide on how access control works

Examples

Create bucket

const { data, error } = await supabase
.storage
.createBucket('avatars', { public: false })