Required Configuration
Cloudinary Credentials
Theconfig object contains your Cloudinary API credentials. These are required for the plugin to authenticate with Cloudinary.
Cloudinary API credentials object
Your Cloudinary cloud name. Find this in your Cloudinary dashboard.
Your Cloudinary API key. Generate this in your Cloudinary console.
Your Cloudinary API secret. Keep this secure and never expose it in client-side code.
Collections
Object mapping collection slugs to their Cloudinary configuration. Use
true for default settings or provide a CollectionOptions object for advanced configuration.collections option specifies which Payload collections should use Cloudinary for file storage. You can:
- Use
truefor default behavior - Pass a
CollectionOptionsobject for advanced configuration (from@payloadcms/plugin-cloud-storage)
Folder Structure
The base folder path in Cloudinary where uploaded files will be stored.
- Files upload to:
my-app/uploads/filename.jpg - Public IDs become:
my-app/uploads/filename - Easy to organize multiple projects in one Cloudinary account
Local Storage
Whether to disable local file storage. When
true, files are only stored in Cloudinary.When
disableLocalStorage is true, the plugin automatically sets upload.disableLocalStorage to true for all configured collections.Plugin Toggle
Whether to enable the plugin. Set to
false to disable Cloudinary storage without removing the plugin configuration.Complete Basic Example
Here’s a complete example with all basic configuration options:Environment Variables
Create a.env file with your Cloudinary credentials:
Next Steps
- Add custom fields to your media collection
- Customize public IDs for better media organization
- Enable versioning to track file changes
- Configure PDF support for document thumbnails