Retrieve public URL
Retrieve URLs for assets in public buckets
- The bucket needs to be set to public, either via updateBucket() or by going to Storage on supabase.com/dashboard, clicking the overflow menu on a bucket and choosing "Make public"
- Policy permissions required:
buckets
permissions: noneobjects
permissions: none
Parameters
path
REQUIRED
stringThe file path to be downloaded, including the path and file name. For example folder/image.png
.
const { publicURL, error } = supabase
.storage
.from('public-bucket')
.getPublicUrl('folder/avatar1.png')