Have Electron get variable on startup

Another potential avenue is to store your device name in EEPROM. The Photon and Electron have 2047 bytes of emulated EEPROM.

Strings are a bit of a challenge.

If you don’t want to re-flash the program to update the name, you can create a Particle.function() to update the name in EEPROM.