Replaces local file storage with Cloudinary for Payload v3 upload collections. It is registered as a plugin and configured per collection, and the upload collection must disable local storage. Requires Cloudinary API credentials, Payload 3 and Node.js 18 or higher.
Cloudinary storage adapter for Payload CMS
Installation
npm i payload-storage-cloudinary7
Stars
2
Forks
3
Open Issues
1 months ago
Last Updated
164
Weekly Downloads
v1.3.0
npm Version
263.6 KB
Unpacked Size
2
Dependencies
7+1 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 7 |
| Dec 4, 2026 | 7 |
| Dec 3, 2026 | 7 |
| Dec 2, 2026 | 7 |
| Dec 1, 2026 | 7 |
| Nov 30, 2026 | 7 |
| Nov 29, 2026 | 7 |
| Nov 28, 2026 | 7 |
| Nov 27, 2026 | 7 |
| Nov 26, 2026 | 7 |
| Nov 25, 2026 | 7 |
| Nov 24, 2026 | 7 |
| Nov 23, 2026 | 7 |
| Nov 22, 2026 | 7 |
| Nov 21, 2026 | 7 |
| Nov 20, 2026 | 7 |
| Nov 19, 2026 | 7 |
| Nov 18, 2026 | 7 |
| Nov 17, 2026 | 7 |
| Nov 16, 2026 | 7 |
| Nov 15, 2026 | 7 |
| Nov 14, 2026 | 7 |
| Nov 13, 2026 | 7 |
| Nov 12, 2026 | 7 |
| Nov 11, 2026 | 7 |
| Nov 10, 2026 | 7 |
| Nov 9, 2026 | 7 |
| Nov 8, 2026 | 7 |
| Nov 7, 2026 | 7 |
| Nov 6, 2026 | 7 |
| Nov 5, 2026 | 7 |
| Nov 4, 2026 | 7 |
| Nov 3, 2026 | 7 |
| Nov 2, 2026 | 7 |
| Nov 1, 2026 | 7 |
| Oct 31, 2026 | 7 |
| Oct 30, 2026 | 7 |
| Oct 29, 2026 | 7 |
| Oct 28, 2026 | 7 |
| Oct 27, 2026 | 7 |
| Oct 26, 2026 | 7 |
| Oct 25, 2026 | 7 |
| Oct 24, 2026 | 7 |
| Oct 23, 2026 | 7 |
| Oct 22, 2026 | 7 |
| Oct 21, 2026 | 7 |
| Oct 20, 2026 | 7 |
| Oct 19, 2026 | 7 |
| Oct 18, 2026 | 7 |
| Oct 17, 2026 | 7 |
| Oct 16, 2026 | 7 |
| Oct 15, 2026 | 6 |
| Oct 14, 2026 | 6 |
| Oct 13, 2026 | 6 |
| Oct 12, 2026 | 6 |
| Oct 11, 2026 | 6 |
| Oct 10, 2026 | 6 |
| Oct 9, 2026 | 6 |
| Oct 8, 2026 | 6 |
| Oct 7, 2026 | 6 |
| Oct 6, 2026 | 6 |
| Oct 5, 2026 | 6 |
| Oct 4, 2026 | 6 |
| Oct 3, 2026 | 6 |
| Oct 2, 2026 | 6 |
| Oct 1, 2026 | 6 |
| Sep 30, 2026 | 6 |
| Sep 29, 2026 | 6 |
| Sep 28, 2026 | 6 |
| Sep 27, 2026 | 6 |
| Sep 26, 2026 | 6 |
| Sep 25, 2026 | 6 |
| Sep 24, 2026 | 6 |
| Sep 23, 2026 | 6 |
| Sep 22, 2026 | 6 |
| Sep 21, 2026 | 6 |
| Sep 20, 2026 | 6 |
| Sep 19, 2026 | 6 |
| Sep 18, 2026 | 6 |
| Sep 17, 2026 | 6 |
| Sep 16, 2026 | 6 |
| Sep 15, 2026 | 6 |
| Sep 14, 2026 | 6 |
| Sep 13, 2026 | 6 |
| Sep 12, 2026 | 6 |
| Sep 11, 2026 | 6 |
| Sep 10, 2026 | 6 |
| Sep 9, 2026 | 6 |
| Sep 8, 2026 | 6 |
| Sep 7, 2026 | 6 |
| Sep 6, 2026 | 6 |
129−297 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 129 |
| Dec 4, 2026 | 106 |
| Dec 3, 2026 | 112 |
| Dec 2, 2026 | 137 |
| Dec 1, 2026 | 133 |
| Nov 30, 2026 | 125 |
| Nov 29, 2026 | 159 |
| Nov 28, 2026 | 179 |
| Nov 27, 2026 | 195 |
| Nov 26, 2026 | 234 |
| Nov 25, 2026 | 212 |
| Nov 24, 2026 | 223 |
| Nov 23, 2026 | 230 |
| Nov 22, 2026 | 216 |
| Nov 21, 2026 | 218 |
| Nov 20, 2026 | 214 |
| Nov 19, 2026 | 162 |
| Nov 18, 2026 | 184 |
| Nov 17, 2026 | 182 |
| Nov 16, 2026 | 183 |
| Nov 15, 2026 | 189 |
| Nov 14, 2026 | 196 |
| Nov 13, 2026 | 211 |
| Nov 12, 2026 | 247 |
| Nov 11, 2026 | 266 |
| Nov 10, 2026 | 261 |
| Nov 9, 2026 | 260 |
| Nov 8, 2026 | 266 |
| Nov 7, 2026 | 260 |
| Nov 6, 2026 | 261 |
| Nov 5, 2026 | 267 |
| Nov 4, 2026 | 237 |
| Nov 3, 2026 | 230 |
| Nov 2, 2026 | 238 |
| Nov 1, 2026 | 229 |
| Oct 31, 2026 | 273 |
| Oct 30, 2026 | 305 |
| Oct 29, 2026 | 252 |
| Oct 28, 2026 | 216 |
| Oct 27, 2026 | 231 |
| Oct 26, 2026 | 217 |
| Oct 25, 2026 | 213 |
| Oct 24, 2026 | 181 |
| Oct 23, 2026 | 104 |
| Oct 22, 2026 | 170 |
| Oct 21, 2026 | 245 |
| Oct 20, 2026 | 261 |
| Oct 19, 2026 | 288 |
| Oct 18, 2026 | 464 |
| Oct 17, 2026 | 467 |
| Oct 16, 2026 | 531 |
| Oct 15, 2026 | 517 |
| Oct 14, 2026 | 483 |
| Oct 13, 2026 | 474 |
| Oct 12, 2026 | 474 |
| Oct 11, 2026 | 349 |
| Oct 10, 2026 | 369 |
| Oct 9, 2026 | 341 |
| Oct 8, 2026 | 361 |
| Oct 7, 2026 | 378 |
| Oct 6, 2026 | 422 |
| Oct 5, 2026 | 468 |
| Oct 4, 2026 | 453 |
| Oct 3, 2026 | 445 |
| Oct 2, 2026 | 445 |
| Oct 1, 2026 | 448 |
| Sep 30, 2026 | 467 |
| Sep 29, 2026 | 432 |
| Sep 28, 2026 | 378 |
| Sep 27, 2026 | 380 |
| Sep 26, 2026 | 389 |
| Sep 25, 2026 | 405 |
| Sep 24, 2026 | 405 |
| Sep 23, 2026 | 389 |
| Sep 22, 2026 | 392 |
| Sep 21, 2026 | 414 |
| Sep 20, 2026 | 409 |
| Sep 19, 2026 | 383 |
| Sep 18, 2026 | 375 |
| Sep 17, 2026 | 327 |
| Sep 16, 2026 | 308 |
| Sep 15, 2026 | 315 |
| Sep 14, 2026 | 292 |
| Sep 13, 2026 | 291 |
| Sep 12, 2026 | 296 |
| Sep 11, 2026 | 334 |
| Sep 10, 2026 | 393 |
| Sep 9, 2026 | 406 |
| Sep 8, 2026 | 406 |
| Sep 7, 2026 | 414 |
| Sep 6, 2026 | 426 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1013339475-root)<a href="https://payloaddirectory.dev/plugins/1013339475-root"><img src="https://payloaddirectory.dev/badge/1013339475-root.svg" alt="Payload Directory"></a>README
A powerful Cloudinary storage adapter for Payload CMS v3 that replaces local file storage with Cloudinary's cloud-based solution, providing automatic image optimization, transformations, and global CDN delivery.
authenticated assets, with per-file privacy controlnpm install payload-storage-cloudinary
# or
yarn add payload-storage-cloudinary
# or
pnpm add payload-storage-cloudinary
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
import { buildConfig } from 'payload'
import { cloudinaryStorage } from 'payload-storage-cloudinary'
export default buildConfig({
// ... your config
plugins: [
cloudinaryStorage({
cloudConfig: {
cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
api_key: process.env.CLOUDINARY_API_KEY,
api_secret: process.env.CLOUDINARY_API_SECRET,
},
collections: {
media: true, // Simple config - just works!
},
}),
],
})
const Media: CollectionConfig = {
slug: 'media',
upload: {
disableLocalStorage: true, // Required - handled by Cloudinary
},
fields: [
{
name: 'alt',
type: 'text',
},
],
}
When you upload a file, the plugin creates several URL fields:
url - The main URL field (always contains the original URL when preserveOriginal: true)originalUrl - Direct URL to the original file without any transformationstransformedUrl - URL with selected transformation presets applied (only when presets are selected)thumbnailURL - Always a 150x150 thumbnail for admin UI displaypublicTransformationUrl - Watermark/blur preview stored by versions before 1.3.0. New uploads don't set it; use previewUrlpreviewUrl - Combines transformation presets with watermark/blur for private filesOn a collection with privateFiles, the plugin builds every URL of a private file when the document is read, after Payload has run the collection's read access. Nothing deliverable is stored in the database, so revoking a reader's access stops them getting new links.
read access passes, and customAuthCheck passes if you set one) gets signed authenticated URLs in url, thumbnailURL and transformedUrl, plus previewUrl when the document has a preview.previewUrl. url, thumbnailURL and transformedUrl are null.null in every URL field.cloudinaryUrl is never in a response, and neither is the originalUrl of a private file. This holds for Local API reads too, where Payload skips field access by default. A public file gets originalUrl built at read time, on every Cloudinary collection with or without privateFiles.The URLs follow the reader of the request. A Local API call without req reads as an anonymous visitor, so pass req to get the URLs your user may see.
Important: When preserveOriginal: true (recommended), transformations are ONLY applied via URL parameters, never during upload. This ensures your original files remain untouched in Cloudinary.
collections: {
media: true, // Just works!
}
collections: {
media: {
folder: 'website/uploads',
},
}
collections: {
media: {
transformations: {
default: {
quality: 'auto',
fetch_format: 'auto',
},
preserveOriginal: true, // Recommended: keeps original file untransformed
},
},
}
Allow users to organize uploads into custom folders:
collections: {
media: {
folder: {
path: 'uploads', // Default folder
enableDynamic: true, // Adds a text field for custom folder paths
fieldName: 'cloudinaryFolder', // Custom field name (optional)
},
},
}
Features:
products/2024 or blog/imagesauthenticated) assets includedUsers can select multiple transformation presets that will be combined:
import { cloudinaryStorage, commonPresets } from 'payload-storage-cloudinary'
collections: {
media: {
transformations: {
default: {
quality: 'auto',
fetch_format: 'auto',
},
presets: commonPresets, // Built-in presets
enablePresetSelection: true, // Shows multi-select dropdown
preserveOriginal: true, // Recommended
},
},
}
Built-in Common Presets:
thumbnail - 150x150 thumb cropcard - 400x400 fill cropbanner - 1200x600 fill cropog-image - 1200x630 Open Graph sizeavatar - 200x200 circular crop with face detectionblur - Blurred preview imagegrayscale - Black and white conversionpixelate - Pixelated effect (20px blocks)How it works:
transformedUrl field contains the URL with all selected transformationsShow a watermarked or blurred preview of a private file to readers who may not get the original. The preview is a signed URL of the authenticated original, so editing it to remove the watermark or blur breaks it. A file uploaded before 1.3.0 needs migrating first:
collections: {
media: {
privateFiles: {
enabled: true,
// Who gets the original. Without it, nobody does.
customAuthCheck: (req) => Boolean(req.user),
},
transformations: {
preserveOriginal: true,
publicTransformation: {
enabled: true,
watermark: {
defaultText: 'PREVIEW',
style: {
fontFamily: 'Arial',
fontSize: 50,
color: 'rgb:808080',
opacity: 50,
angle: -45,
},
},
blur: {
effect: 'blur:2000',
quality: 30,
},
},
},
},
}
How it works:
authenticated assetcustomAuthCheck gets the original URLs and previewUrlpreviewUrl, a signed URL with the selected presets, then the watermark or blurauthenticated original, which is every private upload from 1.3.0 on and every file migratePrivateAssets has moved, Cloudinary answers 401 to a preview URL edited to remove the watermark or blur. A private file uploaded before 1.3.0 stays an upload asset until migrated, so its original is public and its preview is unsigned. Run migratePrivateAssets (see Files Uploaded Before 1.3.0)previewUrl each time the document is readSee Previews for Private Files.
Handle large files with progress tracking:
collections: {
media: {
uploadQueue: {
enabled: true,
maxConcurrentUploads: 3,
enableChunkedUploads: true,
largeFileThreshold: 100, // MB - files larger use chunked upload
chunkSize: 20, // MB chunks
},
},
}
File Size Limits:
upload_large APIimport { buildConfig } from 'payload'
import { cloudinaryStorage, commonPresets } from 'payload-storage-cloudinary'
export default buildConfig({
collections: [
{
slug: 'media',
access: {
// Everyone reads the document, so visitors can get the public preview.
// customAuthCheck below decides who gets the original.
read: () => true,
},
upload: {
disableLocalStorage: true,
},
fields: [
{
name: 'alt',
type: 'text',
},
],
},
],
plugins: [
cloudinaryStorage({
cloudConfig: {
cloud_name: process.env.CLOUDINARY_CLOUD_NAME!,
api_key: process.env.CLOUDINARY_API_KEY!,
api_secret: process.env.CLOUDINARY_API_SECRET!,
},
collections: {
media: {
// Folder configuration
folder: {
path: 'uploads',
enableDynamic: true,
},
// Transformation configuration
transformations: {
default: {
quality: 'auto',
fetch_format: 'auto',
},
presets: commonPresets,
enablePresetSelection: true,
preserveOriginal: true, // Recommended
// Public preview for private files
publicTransformation: {
enabled: true,
watermark: {
defaultText: 'PREVIEW',
style: {
fontFamily: 'Arial',
fontSize: 50,
color: 'rgb:808080',
opacity: 50,
angle: -45,
},
},
blur: {
effect: 'blur:2000',
quality: 30,
},
},
},
// Upload queue for large files
uploadQueue: {
enabled: true,
maxConcurrentUploads: 3,
enableChunkedUploads: true,
largeFileThreshold: 100, // MB
},
// Security: with publicTransformation, only callers who pass
// customAuthCheck get the original. Without it, nobody does.
privateFiles: {
enabled: true,
customAuthCheck: (req) => Boolean(req.user),
},
// Options
resourceType: 'auto',
deleteFromCloudinary: true,
},
},
}),
],
})
function ProductImage({ doc }) {
// Use transformedUrl if transformations were selected, otherwise use url
const imageUrl = doc.transformedUrl || doc.url
return (
<img
src={imageUrl}
alt={doc.alt}
width={doc.width}
height={doc.height}
/>
)
}
Since transformations are applied via URL when preserveOriginal: true, you can easily create variations:
import { getTransformationUrl } from 'payload-storage-cloudinary'
// Create a thumbnail
const thumbnailUrl = getTransformationUrl({
publicId: doc.cloudinaryPublicId,
version: doc.cloudinaryVersion,
customTransformations: {
width: 200,
height: 200,
crop: 'fill',
gravity: 'auto',
}
})
// Create a responsive image
const responsiveUrl = getTransformationUrl({
publicId: doc.cloudinaryPublicId,
version: doc.cloudinaryVersion,
customTransformations: {
width: 'auto',
dpr: 'auto',
quality: 'auto',
fetch_format: 'auto',
}
})
getTransformationUrl, generateSignedURL and generateDownloadURL are primitives. They build a URL for any public ID with any transformation and check no access, and for an authenticated asset they sign it. Call them only from trusted server code, never with a public ID or transformations taken from a request. To serve a reader, use the server helpers below or the signed URL endpoints. See Primitives.
import { useSignedURL, createPrivateImageComponent } from 'payload-storage-cloudinary/client'
import React from 'react'
// Option 1: Use the hook
function MyPrivateImage({ doc }) {
const { url, loading, error } = useSignedURL('media', doc?.id, {
react: React // Required in Next.js
})
if (loading) return <div>Loading...</div>
if (error) return <div>Error loading image</div>
return url ? <img src={url} alt={doc.alt} /> : null
}
// Option 2: Use the pre-built component
const PrivateImage = createPrivateImageComponent(React)
<PrivateImage
doc={doc}
collection="media"
alt="My private image"
className="w-full h-auto"
/>
On the server, the helpers enforce your collection's read access and customAuthCheck. Pass the request, so access resolves against the real reader:
import { getPrivateImageURL } from 'payload-storage-cloudinary'
// null when this reader may not have the file
const url = await getPrivateImageURL(doc, { payload, collection: 'media', req })
A call with no req and no user is anonymous. A trusted server job with no reader passes overrideAccess: true. See Server Helpers.
To ask whether a reader may get the original without building a URL, call isAccessAllowedByID({ req, collection, id }). It decides exactly as the endpoints and the helpers do, in every locale, and returns true exactly when getSignedURL returns a URL. The older isAccessAllowed(req, doc, config) is deprecated: it decides only on the document you pass, so never pass it a raw database row on a localized collection. See isAccessAllowedByID.
getSignedURL, getSignedURLs and getServerImageURL sign caller transformations only from the same allowlist as the endpoints (width, height, crop, gravity, quality, fetch_format, dpr, aspect_ratio). Anything else throws, and nothing is signed. Server code that builds a transformation beyond it, such as a watermark overlay, passes overrideTransformationAllowlist: true. Never pass request input with it. See Transformations in the server helpers.
function ProtectedImage({ doc }) {
if (doc.url) {
// A public file, or a reader who may get the original
return <img src={doc.url} alt={doc.alt} />
}
if (doc.previewUrl) {
// Show the watermarked or blurred preview
return (
<div>
<img src={doc.previewUrl} alt={`${doc.alt} (preview)`} />
<p>This is a preview. Log in to see full quality.</p>
</div>
)
}
// No preview available
return <div>This image requires authentication</div>
}
The plugin now intelligently prevents re-uploads when you:
upload and authenticated instead)The plugin protects against accidental file deletion from Cloudinary:
authenticated) files includedA preview of an authenticated original, which is every private upload from 1.3.0 on and every file migratePrivateAssets has moved, is a signed URL:
previewUrl carries the preview. publicTransformationUrl is deprecatedauthenticated asset, and only readers who pass customAuthCheck get itpublicTransformation collection stays an upload asset until migrated, so its original is public and its preview is unsigned. Run migratePrivateAssets. See Files Uploaded Before 1.3.0url always contains the original URL (when preserveOriginal: true)transformedUrl contains URL with transformation presetspreviewUrl combines presets with watermark/blur, signed for an authenticated originalFull TypeScript support with type definitions included:
import type {
CloudinaryStorageOptions,
CloudinaryCollectionConfig,
TransformationPreset,
SignedURLConfig,
TransformationConfig,
FolderConfig,
} from 'payload-storage-cloudinary'
MIT
Built with ❤️ for the Payload CMS community.
payload storage bunny
Storage adapter for with video streaming, signed URLs and CDN cache purging
753.9k/wk60v4
payload storage sanity
Store Payload media uploads in Sanity Content Lake with crops, focal points and video posters
721.2k/wk0v3
payload s3 upload
Send Payload CMS uploads and resized image variants to Amazon S3 with per-collection configuration
48244/wk70v1
payload cloudinary plugin
Upload Payload media to Cloudinary through an Express middleware and a config plugin
4855/wk76v2
payload storage file explorer
Admin file explorer for browsing and managing S3-compatible buckets inside the Payload admin panel
4532/wk12v3
payload imagekit
Sync Payload media uploads to ImageKit and store selected ImageKit properties in the database
3744/wk24v3