Variables Namespace
Values you set on the dashboard and read while your app runs. Change one without shipping a new build.
The three accessors
// Read three keys you set on the dashboard.std::string banner = Atlas::Variables::Fetch("update_banner");bool debug = Atlas::Variables::FetchBool("debug_enabled");int cap = Atlas::Variables::FetchInt("max_users"); if (!banner.empty()) { ui::ShowBanner(banner);}Fetch
Fetchstd::string Fetch(const std::string& key);Read a string value. Returns
"" if the key doesn't exist.Parameters
| Name | Type | Description |
|---|---|---|
key | string | Key name from the dashboard. |
Returns
stringThe value as a string, or "" when the key is missing.FetchBool
FetchBoolbool FetchBool(const std::string& key);Read a boolean value. Treats
"true", "1", and "yes" as true; anything else is false. Missing key is false.Parameters
| Name | Type | Description |
|---|---|---|
key | string | Key name from the dashboard. |
Returns
boolParsed boolean value.FetchInt
FetchIntint FetchInt(const std::string& key);Read an integer value. Returns
0 when the key is missing or the value is unparseable.Parameters
| Name | Type | Description |
|---|---|---|
key | string | Key name from the dashboard. |
Returns
intParsed integer value.What to use it for
Set them under Dashboard → Variables. Good for a maintenance banner, a feature flag, a forced-upgrade message or a kill switch: anything you want to change without a new build.
Was this page useful?