OK, that makes sense! Then what you could do is pre-register a device before it’s actually activated, and configure an image with those device details. Because you now have a device image you can flash to a device with pre-known UUIDs, you could use the balenaCloud API endpoint to set named environment variables for that unique device UUID to set values. This means that on first bootup, the device would use the preset environment variable values for that device.
By doing this, for example, you could pre-register a device for a user, say ‘Bob User’, set the ‘USER_NAME’ environment variable via our API endpoint (or
balena-cli, or the SDK) to ‘Bob User’ for that specific device UUID, flash the device image with the set device UUID onto a physical device then send that specific device to ‘Bob User’. When the device first boots, the UUID matches the pre-registered and pre-configured envvars, which can be used by your application (which will see a ‘USER_NAME’ of ‘Bob User’).
Hopefully that makes sense, and sounds like the kind of thing you want to do. Of course, it still relies on connecting to our backend to get the right value for the envvar, but it sounds like your devices will be Internet connected.
Please let us know if we can expand on this explanation if it’s not clear!