> ## Documentation Index
> Fetch the complete documentation index at: https://payload-storage-bunny.seshuk.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Configure the payload-storage-bunny plugin with a single bunnyStorage() call, covering top-level options and startup requirements.

You configure the plugin with a single `bunnyStorage(...)` call in your Payload config.

```ts payload.config.ts theme={null}
bunnyStorage({
  collections: { media: true },
  storage: {/* Bunny Storage credentials */},
  stream: {/* Bunny Stream credentials, optional */},
})
```

## Top-level options

| Option          | Type                | Required          | Notes                                                                                                                                                                                                                                                                                    |
| --------------- | ------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collections`   | `object`            | Required          | Which upload collections use Bunny, and their overrides. See [Collection overrides](/configuration/collection-overrides).                                                                                                                                                                |
| `storage`       | `object`            | storage or stream | Bunny Storage credentials, including [`clientUploads`](/configuration/storage/client-uploads). See [Storage](/configuration/storage/overview).                                                                                                                                           |
| `stream`        | `object`            | storage or stream | Bunny Stream credentials. See [Stream](/configuration/stream/overview).                                                                                                                                                                                                                  |
| `accountApiKey` | `string`            | Optional          | Bunny **account** API key (AccessKey). Required for [cache purging](/configuration/cache-purge). The same key — passed via the `BUNNY_ACCOUNT_API_KEY` env var or `--api-key` — is what the [edge-script deploy CLI](/cli/deploy-edge-script) needs (it doesn't read this config field). |
| `purge`         | `boolean \| object` | Optional          | Invalidate the CDN on upload and delete. See [Cache purging](/configuration/cache-purge).                                                                                                                                                                                                |
| `signedUrls`    | `boolean \| object` | Optional          | Serve time-limited signed URLs. See [Signed URLs](/configuration/signed-urls).                                                                                                                                                                                                           |
| `thumbnail`     | `boolean \| object` | Optional          | Admin thumbnails for images and Stream videos. See [Thumbnails](/configuration/thumbnails).                                                                                                                                                                                              |
| `urlTransform`  | `boolean \| object` | Optional          | Rewrite generated public URLs. See [URL transforms](/configuration/url-transforms).                                                                                                                                                                                                      |
| `i18n`          | `object`            | Optional          | Override the TUS toggle button labels per locale.                                                                                                                                                                                                                                        |
| `enabled`       | `boolean`           | Optional          | Set to `false` to turn the whole plugin off. Default `true`.                                                                                                                                                                                                                             |

Provide `storage`, `stream`, or both at the top level — or omit both and give each collection [its own zone or library](/configuration/collection-overrides#own-zone-or-library-per-collection). The plugin only requires that every collection resolves to at least one active service.

## Requirements the plugin enforces

The plugin validates your config on startup and throws a clear error if any of these are missing:

* Every collection listed under `collections` must end up with at least one active service (storage or stream) after overrides are applied — either from the top-level `storage`/`stream` or from a per-collection zone/library.
* A per-collection full config must be complete: storage needs `apiKey`/`hostname`/`zoneName`; stream needs `apiKey`/`hostname`/`libraryId`.
* `purge` (globally or on any collection) requires the global `accountApiKey`.
* `storage.clientUploads` requires Bunny Storage enabled for that collection. A zone with `storage.s3` presigns directly; a zone without `s3` requires `storage.clientUploads.edge.scriptUrl` and `edge.secret`. Non-s3 zones sharing one `edge.scriptUrl` must use the same `edge.secret`. See [Client uploads](/configuration/storage/client-uploads).
* `storage.hostname` must be your Pull Zone hostname, not `storage.bunnycdn.com`.
* If `signedUrls` is enabled and `storage` is configured, `storage.tokenSecurityKey` is required.
* If `signedUrls` is enabled and `stream` is configured, `stream.tokenSecurityKey` is required.
* Any collection using Payload's access control (the default — `disablePayloadAccessControl` isn't `true`) and Stream needs either `mp4Fallback: true` or signed URLs with `staticHandler.useRedirect: true`. See [Stream](/configuration/stream/overview#access-control-and-mp4-fallback).

## Where to go next

* [Storage](/configuration/storage/overview) — Bunny Storage credentials and options
* [Stream](/configuration/stream/overview) — Bunny Stream, TUS uploads, webhooks, cleanup
* [Client uploads](/configuration/storage/client-uploads) — browser-direct uploads for serverless hosts and large files
* [Signed URLs](/configuration/signed-urls) — time-limited, geo-restricted access
* [Thumbnails](/configuration/thumbnails) — admin thumbnails for images and videos
* [Cache purging](/configuration/cache-purge) — invalidate the CDN on change
* [URL transforms](/configuration/url-transforms) — rewrite generated URLs
* [Collection overrides](/configuration/collection-overrides) — tune every option per collection

For copy-ready configurations, see [Examples](/guides/examples).
