Flydrive
The plugin uses a Flydrive driver to store images. It also supplies a Puck Image component. It requires a database plugin for image metadata.
Setup
Install the plugin:
npm install @oberoncms/plugin-flydrive flydriveConfigure a driver with the Flydrive documentation . Export
that driver from oberon/storage.ts. Install any dependencies required by the driver.
Create the plugin in your server config:
import { getFlyDrivePlugin } from "@oberoncms/plugin-flydrive/plugin"
import { driver } from "./storage"
const storagePlugin = getFlyDrivePlugin(driver)Add storagePlugin after the database plugin in your plugin list. The
function returns an OberonPlugin, not a plugin and router pair. Mount the
framework HTTP handler to expose /cms/api/flydrive.
Image component
Import the component in your client config:
import { Image } from "@oberoncms/plugin-flydrive"Add Image to clientConfig.components. Use Image.fields.image when you need the image field in
another Puck component. Use the Puck field reference for nested
fields.
Image deletion attempts both database metadata removal and storage deletion. The plugin reports failures from either operation.
Vercel Blob
The package exports VercelBlobDriver from @oberoncms/plugin-flydrive/vercel. This driver does
not implement the complete Flydrive contract. Do not assume it supports every operation of other
drivers. Use a driver that supports the operations your app requires.