Data

API Reference: Data

Data is an interface for storing key data on Device like user information, login data or token.

JavaScript
JavaScript
const Data = require('sf-core/data');
Data.setStringVariable('userName','Smartface');
Data.setStringVariable('userEmail','info@smartface.io');
Data.setIntVariable('userAge',5);
Data.setBooleanVariable('userLogged',true);
...
if(Data.getBooleanVariable('userLogged')){
router.push('/dashboard', {
userName: Data.getStringVariable('userName'),
userEmail: Data.getStringVariable('userEmail')
});
}
else{
router.push('/login');
}