Skip to main content
An iroh, NetBird, Tailscale or WireGuard network names a device by a long-lived public key. The Network identity extension reports those keys so they appear on the device page, where an operator can copy one.

Requirements

  • nerves_hub_link 2.13.0 or later.
  • NervesHub 2.5.0 or later.
  • A provider module for each network. There is no default provider.

Enable it

1

Write a provider

Implement NervesHubLink.Extensions.NetworkIdentity.Provider. It has one callback, identity/0. This example reports a NetBird identity by parsing the agent’s status:
2

Configure the provider

One provider reports one service. A device on two networks configures two providers.NervesHubLink.Extensions.NetworkIdentity is in the default extension_modules list. If you set extension_modules yourself, that list replaces the default, so name the module in it.
3

Turn it on for the product

In Product settings, on the General tab, switch on Network identity in the Device extensions card. A product created in the web UI starts with every extension on. A product created through the API or nh starts with every extension off.
4

Check the device setting

On the device’s Settings tab, Network Identity in the Extensions card is on by default.

Check that it works

On the device, see what your providers return without sending anything:
In NervesHub, open the device’s Details tab and look at the Network identities card. Each identity shows its service, its identifier with a copy button, any details, and when it was last reported.

What a provider returns

A provider that raises is caught, logged and skipped. An identity is a map:
Never put a secret in details. Anyone who can view the device can read it. NervesHub rejects a details payload over 4KB once encoded.

When identities are sent

  • NervesHub asks for all identities once, when the extension attaches.
  • After that, the device asks its own providers every interval_minutes (default 5) and sends only what changed.
  • Set interval_minutes: 0 to turn the poll off and send only on connect.
A provider that knows the moment its identity changed can send it straight away:
send_identities/0 sends every provider’s identity, changed or not.

Limits

  • NervesHub records at most 10 identities from one report.
  • When an operator has recorded a different identifier by hand in NervesHub, a device report does not replace it.