payload-cloudinary-plugin
payload-cloudinary-plugin copied to clipboard
Upload media to Cloudinary service
payload-cloudinary-plugin
Extends payloadcms
with Cloudinary integration
Current status
Install
yarn add payload-cloudinary-plugin
Get Started
server.ts
import { mediaManagement } from "payload-cloudinary-plugin";
app.use(mediaManagement());
payload.config.ts
import cloudinaryPlugin from "payload-cloudinary-plugin/dist/plugins";
export default buildConfig({
....
plugins: [cloudinaryPlugin()]
....
})
mediaManagement function
function mediaManagement(
config?: ConfigOptions,
uploadApiOptions?: UploadApiOptions,
uploadResourceTypeHandler?: Function
)
The function may receive a ConfigOptions
and a UploadApiOptions
from cloudinary
package.
Additionally, you can specify a uploadResourceTypeHandler
to manage which resource_type
parameter must be passed to cloudinary.upload
(see here: https://cloudinary.com/documentation/image_upload_api_reference#upload_optional_parameters for additional information).
If the uploadResourceTypeHandler
is NOT specified, resource_type: auto
will be passed to upload method.