Skip to content
GitHubXDiscordRSS

WarpDeviceProfile

Create and manage Cloudflare WARP device profiles with custom matching rules and split tunnel configuration.

A Cloudflare WARP Device Profile defines WARP client settings for specific sets of devices based on matching rules. Device profiles allow you to apply different WARP configurations to different groups of devices based on user identity, groups, operating system, or other criteria.

Create a basic device profile for a user group:

import { WarpDeviceProfile } from "alchemy/cloudflare";
const profile = await WarpDeviceProfile("engineering", {
name: "Engineering Team",
match: 'identity.groups.name == "Engineering"',
precedence: 100,
});

Configure which routes bypass the WARP tunnel:

import { WarpDeviceProfile } from "alchemy/cloudflare";
const profile = await WarpDeviceProfile("internal-network", {
name: "Internal Network Access",
match: 'identity.email.ends_with("@company.com")',
precedence: 50,
serviceModeV2: { mode: "warp" },
splitTunnel: {
mode: "exclude",
entries: [
{ address: "10.0.0.0/8", description: "Internal network" },
{ address: "192.168.0.0/16", description: "Local network" }
]
}
});

Only route specific networks through WARP:

import { WarpDeviceProfile } from "alchemy/cloudflare";
const profile = await WarpDeviceProfile("selective", {
name: "Selective Routing",
match: 'identity.groups.name == "Remote Workers"',
precedence: 200,
serviceModeV2: { mode: "warp" },
splitTunnel: {
mode: "include",
entries: [
{ address: "10.0.0.0/8", description: "Company network" },
{ address: "company.com", description: "Company domain" }
]
}
});

Configure all WARP client settings:

import { WarpDeviceProfile } from "alchemy/cloudflare";
const profile = await WarpDeviceProfile("comprehensive", {
name: "Full Configuration",
match: 'identity.email == "admin@example.com"',
precedence: 1,
enabled: true,
serviceModeV2: { mode: "warp" },
disableAutoFallback: false,
allowModeSwitch: false,
switchLocked: true,
tunnelProtocol: "wireguard",
autoConnect: 0,
allowedToLeave: false,
captivePortal: 180,
supportUrl: "https://support.example.com",
excludeOfficeIps: true,
lanAllowMinutes: 5,
lanAllowSubnetSize: 24
});

Take over management of an existing device profile:

import { WarpDeviceProfile } from "alchemy/cloudflare";
const profile = await WarpDeviceProfile("existing", {
name: "Existing Profile",
adopt: true,
match: 'identity.groups.name == "IT"',
precedence: 10
});
PropertyTypeDescription
matchstringWirefilter expression for device matching (e.g., 'identity.groups.name == "Engineering"')
precedencenumberPriority order (lower number = higher priority)
enabledbooleanWhether the profile is enabled
PropertyTypeDescription
serviceModeV2{ mode: "warp" | "proxy" | "doh_only" | "warp_tunnel_only"; port?: number }WARP client operational mode
disableAutoFallbackbooleanDisable automatic fallback to direct connection
allowModeSwitchbooleanAllow users to manually switch WARP modes
switchLockedbooleanLock the WARP toggle switch
tunnelProtocol"wireguard" | "masque"Tunnel protocol to use
autoConnectnumberAuto-connect timeout in seconds (0 to disable)
allowedToLeavebooleanAllow users to disconnect from WARP
captivePortalnumberCaptive portal timeout in seconds
supportUrlstringSupport URL for feedback button
excludeOfficeIpsbooleanExclude office IPs from WARP tunnel
lanAllowMinutesnumberLAN allow duration in minutes
lanAllowSubnetSizenumberLAN subnet size for local network access
PropertyTypeDescription
splitTunnelSplitTunnelConfigSplit tunnel configuration

The SplitTunnelConfig includes:

  • mode: "include" (only specified routes use WARP) or "exclude" (all routes except specified ones use WARP)
  • entries: Array of routes with address (IP/CIDR or domain) and optional description