Migrating
Pick the right guide — upgrading go-unifi 1.x to 2.0, or switching from paultyng/go-unifi.
There are two ways you can arrive at go-unifi 2.0.0. Pick the guide that matches where you're coming from.
Upgrading from go-unifi 1.x
You already use filipowm/go-unifi and want to move to 2.0. A task-oriented walkthrough of every
breaking change, with grep hints and before/after code.
Switching from paultyng/go-unifi
You use the upstream paultyng/go-unifi. The resource methods are the same — only client
construction and authentication differ.
What changed in 2.0.0
The headline changes, all covered in detail by the 1.x upgrade guide:
- API-key authentication only. Username/password login was removed. You authenticate with an API key on a UniFi OS console running UniFi Network 9.0.114 or newer (a Network Application version, distinct from the UniFi OS version).
- Module path is now
/v2. Importgithub.com/filipowm/go-unifi/v2/unifi. - TLS verification is on by default. The old
VerifySSLfield becameSkipVerifySSL— renamed and inverted. - A second API surface.
c.Official()exposes the official UniFi OpenAPI (integration/v1) alongside the legacy Internal API. It's additive — see Choosing a surface. - Go 1.26 is the minimum toolchain.
Want the exhaustive, status-tracked changelog with provenance for every change? See Breaking changes.