payload-cloudinary-plugin
v0.1.14
Published
Extends `payloadcms` with Cloudinary integration
Downloads
246
Readme
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.