A storage bucket in Supabase is a container where you can store and organize files like images, videos, or documents securely in the cloud.
Click to reveal answer
beginner
How do you create a new storage bucket in Supabase?
You create a new storage bucket by using the Supabase dashboard or the Supabase client library, specifying a unique bucket name and setting its privacy (public or private).
Click to reveal answer
beginner
What does setting a bucket to 'public' mean?
Setting a bucket to 'public' means anyone can access the files inside without needing special permission or login.
Click to reveal answer
beginner
Why should you choose 'private' buckets for sensitive files?
Private buckets restrict access so only authorized users or your app can read or write files, protecting sensitive data from public access.
Click to reveal answer
beginner
What is a best practice when naming storage buckets?
Use simple, clear, and unique names without spaces or special characters to avoid confusion and errors.
Click to reveal answer
What is the first step to create a storage bucket in Supabase?
AUpload files immediately
BChoose a unique bucket name
CSet up a database table
DCreate a user account
✗ Incorrect
You must first choose a unique name for your storage bucket before uploading files or setting permissions.
What happens if you set a bucket to private?
AFiles are deleted automatically
BAnyone can access files without login
COnly authorized users can access files
DBucket becomes read-only for everyone
✗ Incorrect
Private buckets restrict access so only authorized users or your app can access the files.
Which of these is NOT a good bucket name?
AMy Bucket!
Bproject_docs
Cuser-photos
Dbackup2024
✗ Incorrect
Bucket names should avoid spaces and special characters like exclamation marks.
Where can you create storage buckets in Supabase?
ABoth B and C
BSupabase client library
CSupabase dashboard
DOnly in external cloud providers
✗ Incorrect
You can create buckets either via the Supabase dashboard or programmatically using the client library.
Why use storage buckets in cloud services like Supabase?
ATo create user accounts
BTo run database queries
CTo host websites
DTo store and organize files securely
✗ Incorrect
Storage buckets are designed to store and organize files securely in the cloud.
Explain how to create a storage bucket in Supabase and what options you must consider.
Think about naming and access control.
You got /3 concepts.
Describe the difference between public and private storage buckets and when to use each.
Consider who can see the files.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of creating a storage bucket in Supabase?
easy
A. To send emails automatically
B. To run server-side code
C. To create a database table
D. To organize and protect files in the cloud
Solution
Step 1: Understand storage bucket purpose
A storage bucket is used to hold and organize files securely in the cloud.
Step 2: Compare options
Options B, C, and D describe other services not related to file storage.
Final Answer:
To organize and protect files in the cloud -> Option D
Quick Check:
Storage bucket = organize and protect files [OK]
Hint: Buckets store files safely in the cloud [OK]
Common Mistakes:
Confusing buckets with databases
Thinking buckets run code
Assuming buckets send emails
2. Which is the correct way to create a private storage bucket named photos in Supabase?
easy
A. supabase.storage.createBucket('photos', { access: 'private' })
B. supabase.storage.createBucket('photos', { public: false })
C. supabase.storage.createBucket('photos', { private: true })
D. supabase.storage.createBucket('photos', { isPublic: true })
Solution
Step 1: Recall correct method signature
The method createBucket takes the bucket name and an options object with a public boolean.
Step 2: Identify correct privacy option
Setting public: false makes the bucket private. Other options use incorrect keys.
Final Answer:
supabase.storage.createBucket('photos', { public: false }) -> Option B
Quick Check:
Use public: false for private bucket [OK]
Hint: Use public: false to make bucket private [OK]