Strapi plugin logo for Cloudflare pages

Cloudflare pages
Plugin verified by Strapi

This plugin lets you easily trigger Cloudflare Pages builds from Strapi.

Strapi plugin cloudflare-pages

NPM version PR Welcome

This is a plugin for Strapi headless CMS. It lets you easily trigger Cloudflare Pages builds from Strapi.

The main branch is compatible with Strapi v4. If you are looking for the version compatible with Strapi v3 please switch to the v3 branch.

Introduction

Screenshot

When using Strapi as a headless CMS for a statically built website you need a way to trigger the site to rebuild when content has been updated. The typical approach is to setup a Strapi managed webhook to trigger a build whenever content changes. This approach has it's issues. For example when making many changes to content, builds are triggered multiple times and deployments can fail due to the site being deployed concurrently. Also you don't have a way to filter entity types for webhooks, so in case you handle a contact form via content creation you will be triggering a new build every time a new message is received.

This plugin tackles the publishing flow a different way. The site administrators can take their time and make many changes and once the content update is complete they can trigger a single build.

You can configure several instances in order to manage preview builds, not just production one.

This plugin takes the approach from the one implemented to trigger builds at github CI/CD, available here.

Installation

Install this plugin with npm or yarn.

With npm:

npm install strapi-plugin-cloudflare-pages

With yarn:

yarn add strapi-plugin-cloudflare-pages

Configuration

Generate a config file at config/plugins.js or config/development/plugins.js etc...

1module.exports = ({ env }) => ({
2  'cloudflare-pages': {
3    enabled: true,
4    config: {
5      instances: [
6        {
7          name: "production website",
8          hook_url: 'https://...'
9        },
10        {
11          name: "preview website",
12          hook_url: 'https://...'
13        },
14      ]
15    }
16  }
17});

Use the Plugin

When the plugin has been installed correctly just click on Cloudflare Pages Publishing in the sidebar under plugins.

Install now

npm install strapi-plugin-cloudflare-pages

STATS

12 GitHub stars63 weekly downloads

Last updated

455 days ago

Strapi Version

Unavailable

Author

github profile image for Hugo Sarti
Hugo Sarti

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.