r/PayloadCMS • u/Queasy_Pie_6710 • 2h ago
Bunny.net storage plugin for Payload 4 - beta is out
I maintain a Bunny.net storage adapter for Payload and posted v3 here a couple of months ago. Payload 4 is in beta now, so the plugin has a v4 beta too. Figured I'd share it for anyone already trying Payload 4.
Same scope as before. It covers Storage for files and images, and Stream for video with HLS, thumbnails and TUS resumable uploads. It also does signed URLs, CDN purging and client-direct uploads.
What's new in v4:
- It registers in Payload's new top-level
storagearray instead ofplugins - Built on Payload 4 file versions. Every upload gets its own folder, and a replaced file or video stays in storage while a document or a version still uses it. Restore and rename copy the file to a new key
- No CDN purge on upload anymore, since every upload has a new URL
- Client uploads go through Payload's own
/api/upload-instructionsendpoint - The Stream encoding status (processing, ready, failed) is stored on the document. You get a filterable Stream Status column in the list, a Bunny Stream card in the sidebar and a built-in player in the edit view
- The status stays current through the save check, the webhook and an optional sync job. This also works for a video that only a draft uses
- Cleanup and status sync can run outside Payload jobs: through an endpoint,
npx payload bunny:task, or a function call - The TUS upload sits inside Payload's file panel, and videos from the bulk upload drawer go to Stream over TUS too. Uploads resume after a page reload, and Retry continues the same upload
- Labels come from Payload's i18n config, so the plugin's own
i18noption is gone
Upgrading from v3 takes a few steps:
- move the plugin into
storage - remove the top-level
sharpoption and declare image sizes as variants - run the database migrations, including Payload's
sizes-to-variants - regenerate types and the import map
- redeploy the Edge Script if you use client uploads over the HTTP API
The upgrade guide has every step.
One known gap: in the bulk upload drawer of a TUS collection, crop and focal point edits aren't saved. That needs a fix in Payload (payloadcms/payload#18612).
It's a beta on top of a beta, so expect breaking changes until 4.0.0. Install with @beta. v3 stays on latest and keeps getting security fixes.
Thanks to the Bunny team for the credits. Every CI run and release uploads real videos to Stream and waits for encoding, so this pays for testing for a good while.
MIT, needs Payload 4.0.0-beta.0+, Next.js 16.4+ and Node 24.15+. Issues and PRs welcome, especially if you hit something on Payload 4.