Convex Bunny Storage

Upload files to Bunny Storage CDN directly from Convex actions with automatic metadata tracking and multi-region support.

Installation

npm install convex-bunny

About Convex Bunny Storage

A Convex component that integrates Bunny.net's global CDN and storage service with your Convex backend. Upload files through Convex actions, store metadata in your database for reactive queries, and serve content through Bunny's edge network. Supports all Bunny Storage regions and provides automatic CDN URL generation with file management capabilities.

Benefits

Use cases

how to upload files to CDN from Convex backend

The Convex Bunny Storage component provides upload actions that send files to Bunny CDN and store metadata in your Convex database. You can upload base64-encoded files through Convex actions and get CDN URLs for immediate delivery.

file storage with metadata tracking in Convex

Convex Bunny Storage automatically stores file metadata in your Convex database when uploading to Bunny CDN. This enables reactive queries to list files, check upload status, and manage file records alongside your application data.

multi-region CDN integration for Convex apps

The component supports all 7 Bunny Storage regions including DE, NY, LA, SG, SYD, BR, and JH. You configure the region during setup and the component handles CDN URL generation for your chosen endpoint.

Frequently asked questions

How do I get Bunny.net API credentials for the Convex Bunny Storage component?

Create a Storage Zone in your Bunny.net dashboard and copy the Storage Zone Password as your API key. You'll also need your CDN hostname in the format your-zone.b-cdn.net for the Convex Bunny Storage component configuration.

Can I query uploaded files reactively in Convex with this component?

Yes, the Convex Bunny Storage component stores file metadata in your Convex database automatically. You can use listFiles queries and getFile queries to reactively display file information in your frontend components.

What file formats can I upload through Convex Bunny Storage?

The Convex Bunny Storage component accepts base64-encoded file data with optional content-type specification. It supports any file format that Bunny Storage accepts, with files delivered through Bunny's global CDN infrastructure.

How does file deletion work with this Convex component?

The Convex Bunny Storage deleteFile action removes files from both Bunny Storage and your Convex database metadata. You can also use removeFileRecord to delete only the database record while keeping the CDN file.

Links