Remote config

Change balance, prices and feature flags without shipping an update. Every response is signed, verified on the device and cached for offline play.

On this page

Value types#

Create keys on the Remote config page. Values are stored as text with a type that tells the SDK how to read them:

TypeExampleLimit
stringWelcome back!Up to 10,000 characters
number25Any finite number
booleanfalsetrue or false
json{"sale": 0.2}Up to 50,000 bytes

Read values#

Getters never fail: they return your fallback when a key is missing or does not convert.

C#
int damage = Majacloud.RemoteConfig.GetInt("enemy_damage", 25);
float speed = Majacloud.RemoteConfig.GetFloat("player_speed", 4.5f);
bool maintenance = Majacloud.RemoteConfig.GetBool("maintenance_mode", false);
string welcome = Majacloud.RemoteConfig.GetString("welcome_message", "Hi!");
ShopConfig shop = Majacloud.RemoteConfig.GetJson<ShopConfig>("shop");

Fetch and updates#

Unity and Godot fetch the config when the game starts; on the web call fetch() yourself. Later fetches send the ETag, so an unchanged config costs one tiny 304 response.

C#
Majacloud.RemoteConfig.ConfigUpdated += config => ApplyBalance();

var fetch = await Majacloud.RemoteConfig.FetchAsync(); // 304 when nothing changed
if (fetch.Ok) Debug.Log("Config v" + fetch.Value.Version + (fetch.Value.Changed ? " (new)" : ""));

Offline and caching#

The last verified config is cached on the device and loaded at startup, so getters work offline and before the first fetch finishes. A fetch that fails because of the network keeps the cached copy; a config older than the cached one is rejected.

Signature verification#

data is the base64url payload, checksum its SHA-256 and signature an RSA-SHA256 signature over data, made with the private key in storage/keys/. The SDKs check all three, plus the project ID and version, before using a config.

SDKWhere the public key comes from
UnityTools ▸ Majacloud ▸ Setup ▸ Test connection
GodotProject ▸ Tools ▸ Majacloud: Test connection
WebThe configPublicKey option (the PEM on the API keys page)
RESTGET /v1/project → config_public_key_pem
Without a pinned key the SDKs fetch it on first use. Pin it for production builds, and keep storage/keys/ in your backups: games pin its public key.

You can verify a response yourself with OpenSSL:

bash
# Verify a config response yourself (what every SDK does before using it)
curl -s https://majacloud.majanite.com/v1/project -H "X-Project-ID: $PROJECT_ID" -H "X-Client-Key: $CLIENT_KEY" | jq -r .project.config_public_key_pem > public.pem
curl -s https://majacloud.majanite.com/v1/config -H "X-Project-ID: $PROJECT_ID" -H "X-Client-Key: $CLIENT_KEY" > response.json

jq -j .data response.json > data.txt
jq -r .signature response.json | base64 --decode > signature.bin
openssl dgst -sha256 -verify public.pem -signature signature.bin data.txt   # Verified OK
jq -r .data response.json | tr '_-' '/+' | base64 --decode 2>/dev/null | jq .     # the payload

History and restore#

Every change is versioned. The dashboard keeps the history for 7 to 365 days depending on the plan and restores any earlier value with one click.

Search page titles, headings and text.

↑↓ to navigate ↵ to open Esc to close