Init function is where your device initialization happens. The function is invoked with an empty state object. Use this function to populate state fields to be used later. It could also be used to setup device credentials or configure some external resources. Here is an example of init function
let serial = glob.get('serial_'+client());
if (!serial) // if serial is not found then create one
serial = chance.guid();
state.serial = serial;
As a result of this code, each of your client will be assigned a unique serial number which will remain persistent throughout all of the simulations. You could always delete the DBStore entries or modify them.
Note that Init function is invoked before the connection is made to your backend server. This is an ideal place to setup any device credentials or set the server settings.