The value of the adminConnectionString option can be retrieved via the Azure portal:
You can select either the Primary or the Secondary connection string.
In production mode the admin connection string is used by the Security Backend, but as there is no Security Backend in development mode, the frontend accesses the Admin API on its own. For this reason the frontend requires the admin connection string.
Usage of Development Mode
Under no circumstances should you publish your web application in development mode. It allows anyone with access to the web application to perform any requests towards your IoT devices and it also exposes the admin connection string that must be kept secret.
Production Mode
For production mode you need to provide a security backend for managing access permissions. You also need a Grant Request Function that acts as an adapter between the ux4iot library and this backend.
The value for the ux4iotURL parameter is available on your ux4iot instance in the Azure portal:
For detailed information on how to implement the Grant Request Function, see the dedicated chapter.
reconnectTimeout & maxReconnectTimeout
When you render a Ux4iotContextProvider, it tries to establish a session by calling the /session endpoint of ux4iot. If this request fails, it will retry again after the milliseconds defined in reconnectTimeout. If the retry fails it will double the timeout and retry again after the doubled timeout or maxReconnectTimeout if maxReconnectTimeout is larger.
Example reconnectTimeout = 5000, maxReconnectTimeout = 50000
Ux4iot fails to connect to ux4iot and fails. Retries afterwards at 5, 10, 20, 40, 50, 50, 50,... seconds
Retries will not stop retrying until the session is established. The defaults are reconnectTimeout = 5000, maxReconnectTimeout = 30000
onSocketConnectionUpdate
In both Development and Production mode you can pass a function to the options of the Ux4iotContextProvider
It takes two arguments:
reason - can be one of four strings:
socket_connect - called when the socket is established with the server
socket_connect_error called when the client throws an error when establishing the socket
socket_disconnect - called when the socket is disconnected
ux4iot_unreachable - called when a sessionId cannot be fetched from the ux4iot instance