✨ We just launched fimo.ai - an AI Website Builder to create websites in minutes - Try it now

Strapi plugin logo for Cloudflare Worker & Pages Deploy

Cloudflare Worker & Pages Deploy

A plugin to trigger Cloudflare Worker and Pages builds from Strapi.

thumbnail for Cloudflare Worker & Pages Deploy

Strapi Plugin Cloudflare Deploy

A plugin to trigger Cloudflare Worker and Pages builds from Strapi.

npm version Strapi v5

Note: This plugin is inspired by strapi-plugin-cloudflare-pages. This version adds support for the newer Cloudflare Workers (in addition to Pages) and is built for Strapi v5.

Features

  • Trigger Cloudflare Workers builds via API
  • Trigger Cloudflare Pages deployments via webhooks
  • Multiple deployment instances support
  • Branch-specific Worker deployments

Requirements

  • Strapi v5
  • Cloudflare account with a Workers or Pages project

Installation

npm install strapi-plugin-cloudflare-deploy
# or
yarn add strapi-plugin-cloudflare-deploy

After installation, rebuild your Strapi admin panel:

npm run build
# or
yarn build

Configuration

Configure the plugin in your config/plugins.ts (examples shown for TypeScript):

export default ({ env }) => ({
    'cloudflare-deploy': {
        enabled: true,
        config: {
            // Account Id and Api Token are only required for Worker instances
            accountId: env('CF_ACCOUNT_ID'),
            apiToken: env('CF_API_TOKEN'),
            instances: [
                {
                    type: 'worker',
                    name: 'Production Worker',
                    triggerUuid: '1cf3cac4-some-trigger-uuid',
                    branch: 'main'
                },
                {
                    type: 'pages',
                    name: 'Production Site',
                    deployHookUrl: env('CF_PAGES_DEPLOY_HOOK')
                }
            ]
        }
    }
});

Configuration Options

PropertyTypeRequiredDescription
accountIdstringFor WorkersCloudflare Account ID
apiTokenstringFor WorkersAPI token with Workers Builds permission
instancesarrayYesArray of deployment targets

Worker Instance Options

PropertyTypeRequiredDescription
type'worker'YesInstance type
namestringYesDisplay name in the admin panel
triggerUuidstringYesBuild trigger UUID from Cloudflare
branchstringNoGit branch to deploy

Pages Instance Options

PropertyTypeRequiredDescription
type'pages'YesInstance type
namestringYesDisplay name in the admin panel
deployHookUrlstringYesFull deploy hook URL from Cloudflare

Obtaining Cloudflare Credentials

Account ID

See Find account and zone IDs in the Cloudflare docs.

API Token (for Workers)

This plugin requires a user API token (account API tokens don't seem to work right now).

  1. Navigate to User API Tokens in your Cloudflare profile
  2. Click Create Token > Create Custom Token
  3. Set the following permissions:
    • Account > Workers Builds Configuration > Edit
    • Account > Workers Scripts > Read (only required for the configuration script)
  4. Click Continue to summary and Create Token
  5. Copy the token immediately (it is only shown once)

Worker Instance Configuration

Use the helper script to generate the instance configuration. You can run it directly without cloning the repository:

curl -fsSL https://raw.githubusercontent.com/Kage0x3B/strapi-plugin-cloudflare-deploy/refs/heads/main/generate-cloudflare-worker-config.sh | sh

Or if you have the repository cloned:

./generate-cloudflare-worker-config.sh

Security Note: Before running scripts from the internet, you should review them first. You can view the script source here. The script only makes read-only requests to two Cloudflare APIs to list your Workers and fetch their build triggers — it does not modify anything.

The script will:

  1. Prompt for your Account ID and API Token
  2. Verify your token and check permissions
  3. List your Workers and let you select one (supports fzf for interactive selection)
  4. List available build triggers and let you select one
  5. Output a ready-to-use instance config

Example output:

{
  name: "my-worker",
  type: "worker",
  triggerUuid: "abc123-def456-...",
  branch: "main",
}

Copy this into your plugin configuration's instances array. You may want to change the name to something more descriptive.

Note: The script requires curl and jq to be installed. Only the 30 most recent Workers are shown.

Pages Deploy Hook URL

  1. Go to Workers & Pages in your Cloudflare dashboard
  2. Select your Pages project
  3. Navigate to Settings > Deploy hooks section
  4. Add a deploy hook, provide a name, and select the branch
  5. Copy the full webhook URL

Usage

  1. Navigate to Cloudflare Deploy in the Strapi admin sidebar
  2. You will see all configured deployment instances
  3. Click Deploy on the instance you want to trigger
  4. Confirm the deployment in the dialog
  5. View the deployment result (success or error message)

Install now

npm install strapi-plugin-cloudflare-deploy

STATS

No GitHub star yet38 weekly downloads

Last updated

17 days ago

Strapi Version

5.0.0 and above

Author

github profile image for Moritz Hein
Moritz Hein

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.