Cloud

Connects a Payload instance to Payload Cloud's managed S3 storage, Cloudflare CDN upload caching, and Resend email delivery.

Official 43,146 2.1k/wk MIT v3.0.4

Installation

pnpm add @payloadcms/plugin-cloud

About

The Payload Cloud plugin wires a self-hosted Payload instance into the managed infrastructure that Payload Cloud provides. It only activates when the `PAYLOAD_CLOUD` environment variable is set to `true` and the expected credentials are in place; otherwise the incoming config is returned unchanged and the instance behaves normally. For every upload collection it sets `disableLocalStorage: true`, registers a custom static handler that reads files from an S3 bucket fronted by Cloudflare's CDN, and adds `beforeChange` and `afterDelete` hooks to push uploads to and remove them from S3. AWS credentials for bucket access are obtained through a Cognito identity pool, configured via a set of `PAYLOAD_CLOUD_COGNITO_*` environment variables. Upload caching sits on top of Cloudflare's CDN and defaults to a 24-hour max-age. It can be overridden globally or per collection slug, and the cache is purged whenever an upload is updated or deleted. Email delivery is handled through Resend's SMTP endpoint via the bundled nodemailer adapter, with a default `from` address derived from the deployed domain or any whitelisted custom domains. An existing email transport in the Payload config takes precedence over the cloud email setup. The plugin also coordinates Payload's jobs queue so that `config.jobs.autoRun` only fires on a single instance, using a hidden `payload-cloud-instance` global to elect the runner. This can be turned off with `enableAutoRun: false`. Each feature (storage, email, upload caching) can be individually disabled through plugin options.

Package info

Package name
@payloadcms/plugin-cloud
Latest version
3.0.4
Unpacked size
91 kB
License
MIT
Weekly downloads
2.1k
Last publish
Mar 14, 2025

More from payloadcms

View profile

Similar plugins

More in Storage