createBucket()
Creates a new Storage bucket
1const { data, error } = await supabase
2 .storage
3 .createBucket('avatars', { public: false })
Parameters#
idrequired
stringA unique identifier for the bucket you are creating.
optionsrequired
objectNo description provided.
publicrequired
booleanThe 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.
Properties
Notes#
- RLS policy permissions required:
bucketstable permissions:insertobjectstable permissions: none
- Refer to the Storage guide on how access control works
Examples#
Create bucket#
1const { data, error } = await supabase
2 .storage
3 .createBucket('avatars', { public: false })