Skip to content

MagicApp

Source: src/Cloudflare/MagicTransit/App.ts

A custom Magic WAN app — a named set of hostnames and/or IP subnets used for traffic steering and policy decisions, complementing Cloudflare’s managed app definitions.

Requires a Magic WAN subscription — accounts without it receive a typed MagicWanUnauthorized error (Cloudflare code 1025).

All properties are mutable in place via PATCH.

App matching hostnames

const app = yield* Cloudflare.MagicApp("crm", {
name: "Internal CRM",
type: "Business",
hostnames: ["crm.example.com"],
});

App matching IP subnets

const app = yield* Cloudflare.MagicApp("voip", {
name: "VoIP",
type: "Communication",
ipSubnets: ["192.0.2.0/24", "198.51.100.0/24"],
});