maximseshuk

payload storage bunny

by maximseshuk
Cloud storage
v4
>=4.0.0-beta.4 <4.0.0-canary.0 || ^4.0.0
>=4.0.0-beta.0 <4.0.0-canary.0 || ^4.0.0 · prerelease
MIT

Overview

Summary generated from the README

Storage adapter that keeps Payload uploads in Bunny Storage and streams video through Bunny Stream. It is registered in the storage array of the Payload config and attached to upload collections. It targets Payload 4 beta or later, Next.js 16.4 or newer, React 19 and a recent Node.js version.

Features

  • Uploads files and images to Bunny Storage served from its CDN
  • Bunny Stream video with HLS/MP4, thumbnails, player and TUS resumable uploads
  • Client-direct uploads from the browser using presigned S3 or a Bunny Edge Script
  • Signed URLs with expiry, country restrictions and IP locking
  • Automatic CDN cache purging when files are deleted
  • Setup wizard CLI that provisions Bunny resources and prints config

Use cases

  • Store Payload media on Bunny's global CDN instead of local disk
  • Host and stream large videos with encoding status shown in the admin
  • Serve private files through time-limited signed links

From the author

Payload storage adapter for Bunny.net

Installation

npm i @seshuk/payload-storage-bunny

60

Stars

7

Forks

7

Open Issues

6 days ago

Last Updated

3.7k

Weekly Downloads

v3.1.2

npm Version

1.0 MB

Unpacked Size

5

Dependencies

GitHub stars

60+3 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 202660
Dec 4, 202660
Dec 3, 202660
Dec 2, 202660
Dec 1, 202660
Nov 30, 202660
Nov 29, 202660
Nov 28, 202660
Nov 27, 202660
Nov 26, 202660
Nov 25, 202660
Nov 24, 202660
Nov 23, 202660
Nov 22, 202660
Nov 21, 202660
Nov 20, 202660
Nov 19, 202660
Nov 18, 202660
Nov 17, 202660
Nov 16, 202660
Nov 15, 202660
Nov 14, 202660
Nov 13, 202660
Nov 12, 202660
Nov 11, 202660
Nov 10, 202660
Nov 9, 202660
Nov 8, 202660
Nov 7, 202660
Nov 6, 202660
Nov 5, 202660
Nov 4, 202660
Nov 3, 202660
Nov 2, 202660
Nov 1, 202660
Oct 31, 202660
Oct 30, 202660
Oct 29, 202660
Oct 28, 202660
Oct 27, 202660
Oct 26, 202660
Oct 25, 202660
Oct 24, 202660
Oct 23, 202660
Oct 22, 202660
Oct 21, 202660
Oct 20, 202660
Oct 19, 202660
Oct 18, 202660
Oct 17, 202659
Oct 16, 202659
Oct 15, 202659
Oct 14, 202659
Oct 13, 202659
Oct 12, 202659
Oct 11, 202658
Oct 10, 202658
Oct 9, 202658
Oct 8, 202658
Oct 7, 202658
Oct 6, 202658
Oct 5, 202658
Oct 4, 202658
Oct 3, 202658
Oct 2, 202658
Oct 1, 202658
Sep 30, 202658
Sep 29, 202658
Sep 28, 202658
Sep 27, 202658
Sep 26, 202658
Sep 25, 202658
Sep 24, 202658
Sep 23, 202658
Sep 22, 202658
Sep 21, 202658
Sep 20, 202658
Sep 19, 202658
Sep 18, 202658
Sep 17, 202658
Sep 16, 202657
Sep 15, 202657
Sep 14, 202657
Sep 13, 202657
Sep 12, 202657
Sep 11, 202657
Sep 10, 202657
Sep 9, 202657
Sep 8, 202657
Sep 7, 202657
Sep 6, 202657
npm weekly downloads

3.5K+815 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 20263,483
Dec 4, 20263,272
Dec 3, 20262,751
Dec 2, 20263,176
Dec 1, 20263,320
Nov 30, 20263,606
Nov 29, 20263,631
Nov 28, 20263,714
Nov 27, 20263,495
Nov 26, 20264,006
Nov 25, 20264,217
Nov 24, 20264,105
Nov 23, 20264,232
Nov 22, 20264,504
Nov 21, 20264,710
Nov 20, 20265,127
Nov 19, 20264,805
Nov 18, 20264,374
Nov 17, 20264,383
Nov 16, 20264,066
Nov 15, 20264,187
Nov 14, 20264,439
Nov 13, 20264,517
Nov 12, 20264,592
Nov 11, 20264,557
Nov 10, 20264,426
Nov 9, 20264,290
Nov 8, 20263,801
Nov 7, 20263,250
Nov 6, 20262,995
Nov 5, 20263,053
Nov 4, 20262,970
Nov 3, 20263,001
Nov 2, 20263,106
Nov 1, 20263,557
Oct 31, 20263,718
Oct 30, 20263,577
Oct 29, 20262,873
Oct 28, 20262,411
Oct 27, 20262,378
Oct 26, 20262,360
Oct 25, 20262,054
Oct 24, 20262,027
Oct 23, 20261,512
Oct 22, 20262,087
Oct 21, 20262,675
Oct 20, 20262,872
Oct 19, 20262,800
Oct 18, 20263,152
Oct 17, 20263,528
Oct 16, 20264,081
Oct 15, 20264,294
Oct 14, 20264,195
Oct 13, 20264,438
Oct 12, 20264,559
Oct 11, 20264,769
Oct 10, 20265,209
Oct 9, 20265,670
Oct 8, 20265,277
Oct 7, 20265,251
Oct 6, 20265,046
Oct 5, 20264,927
Oct 4, 20264,631
Oct 3, 20264,245
Oct 2, 20263,954
Oct 1, 20264,127
Sep 30, 20264,329
Sep 29, 20264,083
Sep 28, 20264,345
Sep 27, 20263,927
Sep 26, 20263,294
Sep 25, 20262,835
Sep 24, 20263,109
Sep 23, 20262,891
Sep 22, 20262,871
Sep 21, 20262,518
Sep 20, 20262,514
Sep 19, 20262,437
Sep 18, 20262,427
Sep 17, 20261,938
Sep 16, 20261,682
Sep 15, 20261,748
Sep 14, 20261,697
Sep 13, 20261,662
Sep 12, 20261,677
Sep 11, 20261,740
Sep 10, 20261,891
Sep 9, 20262,134
Sep 8, 20262,242
Sep 7, 20262,576
Sep 6, 20262,668

Each point is npm's rolling 7-day download count.

Health Score

75/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/922465872-root.svg)](https://payloaddirectory.dev/plugins/922465872-root)
HTML
<a href="https://payloaddirectory.dev/plugins/922465872-root"><img src="https://payloaddirectory.dev/badge/922465872-root.svg" alt="Payload Directory"></a>
Updated Nov 29, 2026Created Jan 26, 2025Published Oct 1, 2026

README

Bunny.net Storage for Payload

Bunny.net Storage for Payload

Bunny.net — Fast Global CDN

Store files and stream video from Payload on Bunny's fast global CDN.

GitHub release npm version npm downloads CI Documentation license Ko-fi

Features

  • Bunny Storage — upload files, images, and documents to Bunny's global CDN.
  • Bunny Stream — video with HLS/MP4 streaming, adaptive bitrates, thumbnails, a built-in player, and TUS resumable uploads for large files.
  • Stream status — see in the admin whether each video is still encoding, ready, or failed.
  • File versions — with Payload versions (on by default in Payload 4), a replaced file or video stays in Bunny while a version uses it, so restoring a version brings back a working file. Set versions: false on a collection to delete the old file on replace.
  • Client-direct uploads — file bytes go straight from the browser to Bunny (presigned S3 or a Bunny Edge Script), bypassing serverless body-size limits.
  • Signed URLs — time-limited links with country restrictions and per-client IPv4 locking, for both Storage and Stream.
  • CDN cache purging — auto-invalidate the CDN when a file is deleted. Every upload gets a new URL, so visitors never see an old copy of a replaced file.
  • Thumbnails — admin-panel and API previews, with on-the-fly resizing via Bunny Optimizer.
  • Per-collection overrides — tune any setting per collection, or point a collection at its own zone / library for multi-tenant setups.
  • Setup wizard & CLI — one command provisions your Bunny resources and prints ready-to-paste options; a second deploys the client-uploads Edge Script.

Screenshots

A resumable TUS upload straight from the browser to Bunny Stream:

A video uploading over TUS in the edit view

The Stream status in the list view, with a filter:

The list view filtered by Stream status, with a ready and a processing video

The Bunny Stream player and the status card in the edit view:

A ready video with the Bunny Stream player and the status card

An image served from Bunny Storage:

An image document stored in Bunny Storage

Quick start

Requires Payload 4.0.0-beta.4 or later (canary builds are not supported), Next.js >=16.4 <17, React 19 and Node.js 24.22.1 or later. For Payload 3, use @seshuk/payload-storage-bunny@3.

[!IMPORTANT] Upgrading from v3? Register the adapter under storage instead of plugins. Some options are renamed, and the plugin throws at startup with the new name for each old key. Custom upload clients must move to Payload's POST /api/upload-instructions endpoint, and SQL databases need a migration for the new upload fields (prefix, the original group, and prefix and _objectKey on image variants). Every database, MongoDB too, first needs Payload's sizes-to-variants migration. Follow the Upgrade Guide.

Upgrading from v2? Upgrade to v3 on Payload 3 first and run its one-time data migration. The migration helper ships only in v3 and is removed in v4. Back up your database, then follow the same Upgrade Guide.

One interactive command provisions the Bunny resources you need — storage zone, pull zone, and/or video library — with production defaults, then prints a ready-to-paste bunnyStorage({ … }) block and the matching .env lines. Nothing billable is created without confirmation.

npx @seshuk/payload-storage-bunny@beta init

See the Setup Wizard docs. Prefer to wire it up by hand? Follow the Quick Start.

Install

npm install @seshuk/payload-storage-bunny@beta @payloadcms/[email protected] @payloadcms/[email protected] @payloadcms/[email protected] [email protected]

v4 is in beta under the beta npm tag, and Payload 4 is published under beta. The command also installs the peer dependencies that a Payload app does not have yet. payload and React 19 are already in your app. Use the same exact version for @payloadcms/plugin-cloud-storage, @payloadcms/translations, @payloadcms/ui and your payload package. For Payload 3, use @seshuk/payload-storage-bunny@3.

Configure

Add the adapter to the storage array of your Payload config, pointing it at an upload collection:

import { bunnyStorage } from '@seshuk/payload-storage-bunny'
import { buildConfig } from 'payload'

export default buildConfig({
  storage: [
    bunnyStorage({
      collections: {
        media: {
          prefix: 'media',
          disablePayloadAccessControl: true, // serve directly from Bunny's CDN
        },
      },
      storage: {
        apiKey: process.env.BUNNY_STORAGE_API_KEY!,
        hostname: process.env.BUNNY_STORAGE_HOSTNAME!, // your Pull Zone host, e.g. example.b-cdn.net
        zoneName: process.env.BUNNY_STORAGE_ZONE_NAME!,
      },
    }),
  ],
})

Add stream for video, purge for cache invalidation, signedUrls for secure links, and more — see the configuration reference.

Documentation

Full docs are at https://payload-storage-bunny.seshuk.im/:

Telemetry

The plugin sends an anonymous, opt-out usage report once per day: plugin, Payload, and Node versions plus which features are enabled. It never sends secrets, IPs, keys, zone/library names, hostnames, countries, file paths, or collection names. A one-time notice prints on first run.

Opt out with telemetry: false, DO_NOT_TRACK=1, or BUNNY_TELEMETRY_DISABLED=1 (also disabled automatically in CI and when payload.config.telemetry is false). See Telemetry for the full list of what is and isn't collected.

Support

Bug reports, feature requests, and questions go to GitHub Issues. For Payload itself, see the Payload docs and Discord.

License

MIT — see LICENSE.

Credits

Built by Maxim Seshuk for the Payload community.

If this plugin saves you time, you can buy me a coffee ☕


Disclosure: links to bunny.net in this README are referral links.

Similar plugins