The Neutrinos Platform provides a set of predefined system variables which includes system-defined variables and services that can be used across apps. You can call these variables using bh.system.<system_variable>.

System variables and services include:

Variable or Service Summary
bh.system.currentUser Provides information about the currently logged-in user. This will be undefined if the app does not use authentication or if no user has logged in.
bh.system.environment Provides information about the current environment that the app is built on. For example- Dev, Prod.
bh.system.tokenService  Provides methods for authentication token management on the front end. 
bh.system.deviceService Provides methods and variables to get the application and platform-specific information.
bh.system.localStorageSystem Provides access to the data stored in the local storage of the client. 
bh.system.loginservice Provides methods and variables for a user to log in to an application.
bh.system.logoutService Provides methods and variables for a user to log out of the application.

bh.system.notificationService

Provides push notifications to the app.
bh.system.pubsubService Provides methods to publish and subscribe to events with various types of callbacks.
bh.system.httpLoaderService Listens to HTTP requests and indicates its progress.


System variables: 

System variables are specific to a system or a platform in which you create your app.

Syntax:

JavaScript
bh.system.<system_variable>;

Returns:

The value associated with the variable at that particular time. For example, bh.systsem.environment returns information about the current environment that the app is built on.


System Services

The following are the pre-defined system services that you can use across your apps: 


Access system variables from a UI Service

You can access the system variables from any flow by using bh.system.<variable>. For example, if you have a service which requires Neutrinos Art authentication, then you can drag and drop a Script node to your flow, and use the bh.system.loginService.login() method.