bunnyStorage(...) call in your Payload config.
payload.config.ts
Top-level options
Provide
storage, stream, or both at the top level — or omit both and give each collection its own zone or library. 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
collectionsmust end up with at least one active service (storage or stream) after overrides are applied — either from the top-levelstorage/streamor from a per-collection zone/library. - A per-collection full config must be complete: storage needs
apiKey/hostname/zoneName; stream needsapiKey/hostname/libraryId. purge(globally or on any collection) requires the globalaccountApiKey.storage.clientUploadsrequires Bunny Storage enabled for that collection. A zone withstorage.s3presigns directly; a zone withouts3requiresstorage.clientUploads.edge.scriptUrlandedge.secret. Non-s3 zones sharing oneedge.scriptUrlmust use the sameedge.secret. See Client uploads.storage.hostnamemust be your Pull Zone hostname, notstorage.bunnycdn.com.- If
signedUrlsis enabled andstorageis configured,storage.tokenSecurityKeyis required. - If
signedUrlsis enabled andstreamis configured,stream.tokenSecurityKeyis required. - Any collection using Payload’s access control (the default —
disablePayloadAccessControlisn’ttrue) and Stream needs eithermp4Fallback: trueor signed URLs withstaticHandler.useRedirect: true. See Stream.
Where to go next
- Storage — Bunny Storage credentials and options
- Stream — Bunny Stream, TUS uploads, webhooks, cleanup
- Client uploads — browser-direct uploads for serverless hosts and large files
- Signed URLs — time-limited, geo-restricted access
- Thumbnails — admin thumbnails for images and videos
- Cache purging — invalidate the CDN on change
- URL transforms — rewrite generated URLs
- Collection overrides — tune every option per collection