---
id: storage-from-getpublicurl
title: 'from.getPublicUrl()'
slug: storage-from-getpublicurl
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---
import Tabs from '@theme/Tabs'
import TabsPanel from '@theme/TabsPanel'
Retrieve URLs for assets in public buckets
```js
const { publicURL, error } = supabase.storage
.from('public-bucket')
.getPublicUrl('folder/avatar1.png')
```
## Parameters
## Notes
- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.com](https://app.supabase.com), clicking the overflow menu on a bucket and choosing "Make public"
- Policy permissions required:
- `buckets` permissions: none
- `objects` permissions: none
## Examples
### Returns the URL for an asset in a public bucket
```js
const { publicURL, error } = supabase.storage
.from('public-bucket')
.getPublicUrl('folder/avatar1.png')
```