Files
supabase/apps/temp-docs/docs/reference/javascript/storage-getbucket.mdx
2022-04-26 14:17:19 +02:00

96 lines
1.4 KiB
Plaintext

---
id: storage-getbucket
title: "getBucket()"
slug: storage-getbucket
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Retrieves the details of an existing Storage bucket.
<Tabs
defaultActiveId="js"
groupId="reference/supabase-js"
values={[{ label: 'JavaScript', value: 'js' }]}>
<TabsPanel id="js" label="js">
```js
const { data, error } = await supabase
.storage
.getBucket('avatars')
```
</TabsPanel>
</Tabs>
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
id
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>string</code>
</span>
</h4>
<div class="method-list-item-description">
The unique identifier of the bucket you would like to retrieve.
</div>
</li>
</ul>
## Notes
- Policy permissions required:
- `buckets` permissions: `select`
- `objects` permissions: none
## Examples
### Get bucket
<Tabs
defaultActiveId="js"
groupId="reference/supabase-js"
values={[{ label: 'JavaScript', value: 'js' }]}>
<TabsPanel id="js" label="js">
```js
const { data, error } = await supabase
.storage
.getBucket('avatars')
```
</TabsPanel>
</Tabs>