client.storage.listBuckets
List all storage buckets.
Signature
class Client {
storage: {
listBuckets(): Promise<StorageBucket[]>
}
}
Examples
const buckets = await bf.storage.listBuckets()
for (const b of buckets) {
console.log(`${b.name} — ${b.public ? 'public' : 'private'} (${b.size} bytes)`)
}
Throws
| Error | Condition |
|---|---|
| API request failed |
| Network issue |
Pitfalls
- Empty result — a project with no buckets returns an empty array
See also
{auto-injected}
Tested against
{auto-injected}