Skip to content
Docs

Cloudflare

Get a push for Cloudflare Pages deployments, Workers Builds, and any other Cloudflare notification like origin errors or DDoS alerts.

Cloudflare sends its notifications to a webhook destination. Point that destination at Opush and you get pushes for Pages deployments and for any other Cloudflare notification: origin errors, DDoS attacks, health checks, Workers alerts and more. Workers Builds need one extra step, described below.

Set it up

Create the integration in Opush

In the app or the web console, add a service integration and pick Cloudflare. Give it a name if you like. Copy the Payload URL and the Secret.

Add a webhook destination

In the Cloudflare dashboard, open Notifications › Destinations and create a webhook.

  • URL: the payload URL from Opush.
  • Secret: the secret from Opush.

Click Save and Test. Cloudflare sends a test message, and you get a "Webhook connected" push.

Add notifications

Open Notifications › Add. Pick Pages › Project updates, or any other notification, and choose this webhook as the destination. Add as many notifications as you like to the same destination.

Cloudflare puts the secret in the cf-webhook-auth header. Opush rejects requests where it doesn't match.

What gets pushed

Cloudflare eventSubtitleMessage
Destination test messageWebhook connectedCloudflare can reach Opush.
Pages deployment succeededDeployedproduction · abcdef1 · rocket
Pages deployment failedDeploy failedproduction · abcdef1 · rocket
Workers Builds failedapi · FailedBump deps · main · api-repo
Any other notificationThe notification's nameIts description
  • Pages: the message has the environment, the first 7 characters of the commit and the project. Tapping the push opens the deployment's URL. Deployments that start only open a live progress card. Cancelled deployments aren't pushed.
  • Workers Builds: the subtitle is the Worker's name and the result. The message has the commit message, the branch and the repository. Cancelled builds aren't pushed.
  • Other notifications: for example an origin error alert shows Origin errors with 5xx rate is above 5%. When Cloudflare says the alert has ended, "Resolved" is added to the subtitle.

Failed Pages deployments and failed Workers builds arrive as time-sensitive notifications.

Workers Builds

Workers Builds don't send webhooks. They only publish events to a Cloudflare Queue through an event subscription. To get them in Opush, forward the queue to your payload URL with a small Worker.

  1. Create a queue, and add an event subscription that sends Workers Builds events for your Worker to it.
  2. Create a Worker that consumes the queue and posts each message to Opush as is:
export default {
  async queue(batch, env) {
    for (const msg of batch.messages) {
      await fetch(env.OPUSH_URL, {
        method: "POST",
        headers: { "content-type": "application/json", "cf-webhook-auth": env.OPUSH_SECRET },
        body: JSON.stringify(msg.body),
      });
      msg.ack();
    }
  },
};
  1. Set OPUSH_URL to the payload URL and OPUSH_SECRET to the secret from Opush. Keep the secret as a Worker secret, for example with wrangler secret put OPUSH_SECRET.

You can use the same integration for Pages, Workers Builds and other notifications.

Options

  • Only push failures: skip pushes for Pages deployments and Workers builds that succeed.
  • Show progress as a Live Activity (iPhone and Android apps): when a Pages deployment or a Workers build starts, a live progress card shows how long it has been running. It ends when it succeeds, fails or is cancelled. Cloudflare doesn't send build steps, so the card has no progress bar.

See Live progress for how cards look on iPhone and Android.