Requirements
nerves_hub_link2.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
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:What a provider returns
A provider that raises is caught, logged and skipped.
An identity is a map:
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(default5) and sends only what changed. - Set
interval_minutes: 0to turn the poll off and send only on connect.
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.

