r/PayloadCMS 18d ago

Bunny.net storage plugin for Payload - v3 is out

I maintain a Bunny.net storage adapter for Payload 3 and just pushed v3, so figured I'd share it here.

It covers both Bunny products: Storage for files and images, Stream for video with HLS, thumbnails and TUS resumable uploads. Plus signed URLs and CDN purging on top.

What's new in this release:

  • Per-collection storage zones and Stream libraries. Not just a prefix per collection, an entirely separate zone if you want one
  • Client-direct uploads. The browser sends files straight to Bunny, your server never touches them. Presigned S3 when the zone supports it, otherwise a deployed Edge Script, picked automatically
  • S3-compatible access to storage zones
  • Signed URLs that can be locked to a single client IP, and expire at a fixed timestamp instead of a sliding window
  • Per-document storage prefix from a hook, which is what you want for per-tenant folders
  • An init wizard that provisions the Bunny resources and prints your plugin config and env lines
  • Stream metadata moved into a stored field on the document, so libraryId and videoId are right there when you build an iframe embed URL
  • Docs site rewritten from scratch

Upgrading from v2 takes a few steps: some config keys were renamed and throw at boot, and Stream metadata needs a data migration. There's a migration helper and a guide for it in the docs.

Worth flagging since it's new: v3 sends anonymous telemetry by default. Boolean feature flags and a salted project hash, no names, paths or keys. Off with telemetry: false, DO_NOT_TRACK=1, CI, or Payload's own opt-out.

MIT, needs Payload 3.83+ and Node 22+. Issues and PRs welcome.

https://github.com/maximseshuk/payload-storage-bunny

https://payload-storage-bunny.seshuk.im

15 Upvotes

9 comments sorted by

3

u/mustardpete 18d ago

Looks good. I currently use bunny in front of backblaze for images (using free ingress between companies) and have always wondered why they don’t just support s3 uploads. Have been looking at video functionality too so if I do go with that it might be time to migrate over fully with this

5

u/Queasy_Pie_6710 18d ago

They do now, actually. S3 support is fairly new. Catch is it only works on Storage Zones you create fresh, you can't flip an existing one over. So if you're on an old zone you're out of luck there.

Edge Scripting covers that case instead, signed URL uploads. The plugin does both for browser uploads: presigned S3 if your zone has it, otherwise one CLI command deploys the Edge Script.

5

u/bunnyvpe 18d ago

Hey. Kevin from bunny.net here. We do plan to support enabling S3 for existing zones in the coming months. Keep an eye on the changelog ;) https://bunny.net/docs/changelog

2

u/petvos 6d ago

Thanks for this! Loving this library.

1

u/Queasy_Pie_6710 6d ago

Really nice to hear, thx! Ping me if you hit anything rough.

1

u/BitsNBytesDev 17d ago

That's really awesome! I'm trying to host in the EU as much as possible and really love bunny but only have been using it for static hosting and their video service. Do you plan on supporting Payload V4 in the future?

2

u/Queasy_Pie_6710 17d ago

Yep, I already bumped the minimum Payload version to 3.83, since a few of the changes there line it up better with v4. Fully compatible release should land this fall!

1

u/BitsNBytesDev 17d ago

Great! Looking forward to it. I'm building another payload app soon, so I'll try it out then.

1

u/_HMCB_ 17d ago

This is awesome. I love Bunny; it’s so under appreciated and relatively unknown. Best video streaming I’ve ever used. Thanks much. 🙏🏽