Select files from a bunny.net Storage Zone inside DatoCMS and save the selected asset data in JSON fields.
After installing the plugin, configure:
| Setting | Description |
|---|---|
| Storage Zone Name | The name of your bunny.net Storage Zone |
| Storage API Key | The API key from the Storage Zone FTP & API Access settings |
| CDN Hostname | Your Pull Zone hostname, for example my-zone.b-cdn.net |
| Storage Region | The region where your Storage Zone is hosted |
Supported regions:
Create or edit a JSON field in DatoCMS, then choose one of these manual field editors:
The plugin stores a stringified JSON value in the JSON field.
Single asset, after parsing:
{ "path": "folder/image.jpg", "filename": "image.jpg", "size": 153240, "contentType": "image/jpeg", "url": "https://my-zone.b-cdn.net/folder/image.jpg", "guid": "8e3b3b4e-1f6a-4b2a-9b8a-2f1e6d7c8a9b", "lastChanged": "2025-04-30T10:21:00.000"}Multiple assets, after parsing:
[ { "path": "folder/image.jpg", "filename": "image.jpg", "size": 153240, "contentType": "image/jpeg", "url": "https://my-zone.b-cdn.net/folder/image.jpg", "guid": "8e3b3b4e-1f6a-4b2a-9b8a-2f1e6d7c8a9b", "lastChanged": "2025-04-30T10:21:00.000" }]Example frontend usage:
const asset = JSON.parse(record.bunnyAsset);const url = asset.url;For the multiple-asset editor, parse the field as an array.
If your Pull Zone has bunny Optimizer enabled, you can transform images on the fly by appending query parameters to the stored url.
const asset = JSON.parse(record.bunnyAsset);
const thumbnail = `${asset.url}?width=400&height=300&aspect_ratio=4:3`;const webp = `${asset.url}?format=webp&quality=80`;Common parameters:
width, height for resizing the imageaspect_ratio to crop to a ratio, for example 16:9format to convert to webp, avif, jpg, or pngquality for compression quality from 0 to 100See the bunny Optimizer docs for the full list of options. Optimizer must be enabled on your Pull Zone for these parameters to take effect.
npm installnpm run devnpm run build