Automate Cloudflare with TypeScript
Manage accounts, zones, DNS records, cache, health checks, and notification policies. Trigger automations from DDoS, certificate, and origin-health alerts.
import { automation } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"
export default automation("Watch origin health", () => {
const event = cloudflare.onOriginHealthCheckStatusChanged({
accountId: "account-id",
})
cloudflare.purgeCache({
zoneId: "zone-id",
purgeEverything: true,
})
})What you can do
Actions
- List accounts and manage zones
- Create, update, and delete DNS records
- Purge cache and manage health checks
- Inspect notification history and manage policies
Triggers
- Any selected notification alert type
- Layer 4 and Layer 7 DDoS attacks
- SSL and Access certificate events
- Origin health-check status changes