You can create variables that can take on new values from the server. This allows you to roll out changes without having to push a code change to your server. You can also create A/B tests to change variables for only a percentage of your users.

Variable data comes back asynchronously when the app starts. If you need to use a variable when the app starts, make sure you use callbacks.

Sets your variables.

  StoreTitle: "Powerup Store",
  Items: [
      name: "Speed Boost",
      price: 100
    }, {
      name: "Health Boost",
      price: 150

Gets your variables.

var variables = Leanplum.getVariables();
//Gets a particular variable.
var title = Leanplum.getVariable('StoreTitle');
var speedBoost = Leanplum.getVariable('Items', 0);
var healthBoostName = Leanplum.getVariable('Items', 1, 'name');