Skip to main content

Unifi Networks

@shrug/unifi-networksv2026.07.22.1· 10d agoMODELSREPORTS
01README

Query UniFi Network sites via the official integration API — VLANs, firewall zones/policies, connected clients, and WiFi SSIDs, all mapped together — with firewall-summary and zone-matrix reports. Local (per-console key) or cloud (unifi.ui.com key, multi-console fan-out) mode. Also fetches UDM OS/app update status via the management-plane websocket (scanUpdates). Vendored from @dmc/unifi-networks (MIT, Dan McClain) with fixes: optional policy name, and correct PRESET protocol rendering.

Install & run: swamp extension pull @shrug/unifi-networks swamp model create @shrug/unifi-networks my-unifi
--global-arg mode=local --global-arg host=192.0.2.1
--global-arg 'apiKey=${{ vault.get("unifi", "integration-key") }}' swamp model method run my-unifi scan swamp model method run my-unifi scanFirewall # renders both reports

See README.md for the full method list, scanUpdates setup, and reading results back via the data model.

02Models1
@shrug/unifi-networksv2026.07.22.1unifi_networks.ts

Global Arguments

ArgumentTypeDescription
modeenumConnection mode. Determines which API key you must create:
apiKeystringUniFi API key matching the chosen mode
host?stringConsole hostname or IP — required when mode='local' (e.g. 192.0.2.1)
consoleId?stringCloud console ID to target. When mode='cloud' and omitted, all consoles
verifyTlsbooleanVerify the console's TLS certificate in local mode. Set false for the
username?stringUniFi OS local admin username — required for scanUpdates.
password?stringUniFi OS local admin password — required for scanUpdates.
fn consoles()
List UniFi consoles visible to the cloud API key (cloud mode only).
fn scan()
Fetch all networks/VLANs. Local mode scans the configured host; cloud
fn scanFirewall()
Fetch firewall zones and policies per site, joined so policies show
fn scanWifi()
Fetch WiFi broadcasts (SSIDs) per site and map each to its VLAN via
fn scanUpdates()
Fetch UniFi OS firmware and application update status via the management-plane
fn scanClients()
Fetch connected clients per site and map each to its VLAN/network by
fn deletePolicy(siteId: string, policyId: string, consoleId?: string)
Delete a single user-defined firewall policy by ID. Verifies the
ArgumentTypeDescription
siteIdstringSite ID containing the policy
policyIdstringFirewall policy ID to delete
consoleId?stringConsole to target when the key sees more than one

Resources

consoles(infinite)— UniFi consoles visible to the cloud API key
siteNetworks(infinite)— Networks (VLANs) per UniFi site
siteFirewall(infinite)— Firewall zones and policies per UniFi site
siteClients(infinite)— Connected clients per UniFi site, mapped to VLAN by IP subnet
siteWifi(infinite)— WiFi broadcasts (SSIDs) per UniFi site, mapped to VLAN by network
consoleUpdates(infinite)— UniFi OS firmware and application update status from the management-plane websocket
03Reports2
@shrug/unifi-firewall-summarymethod
unifi_firewall_summary.ts

Zone inventory and a detailed firewall policy table (flow, action,

networkingunififirewallsecurity
@shrug/unifi-zone-matrixmethod
unifi_zone_matrix.ts

Source→destination firewall posture between zones (from catch-all

networkingunififirewallsecurity
04Previous Versions1
2026.07.21.8
05Stats
A
100 / 100
Downloads
1
Archive size
35.9 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels