Skip to main content
You configure the plugin with a single 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 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.
  • 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.

Where to go next

For copy-ready configurations, see Examples.