Remote Config
Dynamic configuration values your app fetches at runtime, with stored segment and percentage conditions.
Remote config lets you change app behavior without shipping an update. Set key / value pairs on the server and the SDK fetches them with config.fetch(). Keys can also carry per-segment or percentage-rollout conditions, which apply to signed-in users; a caller without a session gets each key's default value.
How it works
- Admins (or AI agents via MCP) set config values on the server. Every value has a type (
string,number,boolean,json) and optional stored conditions for specific segments or a percentage of users. - The client SDK fetches the key → value map from
GET /v1/client/config. It keeps the last map it fetched on the device, per project and signed-in user, andconfig.getCached(key, default)reads it with no request: on the next launch the first screen gets the last known values, then the app's shippedconfigDefaults, then the default passed to the call. See startup values. The response carriesCache-Control: private, max-age=300, so in a browser a repeatconfig.fetch()within five minutes can return the browser's cached copy. - The route returns an
ETagheader. A request that sends it back inIf-None-Matchgets304 Not Modifiedwhile nothing changed, which helps when you call the route yourself. The SDK'sfetch()sends noIf-None-Matchand always receives the full map. - Server-side version hashes make change detection fast: flipping a value bumps
config_versions.version_hash, which changes theETag.
SDK usage
Method signatures:
Read a value on the first frame
Pass the values your app ships with at configure, then read with getCached. It answers at once from the last fetch, the device cache, configDefaults, then your default; the first call also starts a background fetch that refreshes the cache. Every SDK has it (per-platform signatures).
Get a single value
Because each value is typed as unknown, cast to your expected type. Always provide a default:
Get the full config map
Refresh
Expo
Amba.config.fetch() returns the full ConfigBundle ({ version, values }); read individual keys off values.
Manual refresh in Expo
Conditional values
A config key can carry conditions that target segments or a percentage of users. GET /v1/client/config evaluates them for a signed-in user, in order, and returns the value of the first condition that matches; a caller without a session gets the default value.
Example schema stored in remote_configs.conditions:
This stores a default of false with a seg_power_users override and a 25% rollout condition; GET /v1/client/config returns false.
Kill switch
Every key can be switched off without deleting it. A switched-off key (is_active: false) is left out of GET /v1/client/config. The SDK's next successful fetch removes it from the device cache, so config.getCached returns the app's shipped configDefaults value for it, then the caller's default; ship the safe value as the default. Its value, conditions and history stay as they are, and switching it back on serves it again. Switching a key off or on changes the ETag, so an HTTP cache revalidating with If-None-Match gets the new map; the SDK replaces its device cache on its next fetch.
From an agent, amba_remote_configs_set_active does the same in one call:
GET /v1/admin/projects/:projectId/config lists every key with its is_active, so a switched-off key stays visible to you. A scheduled content delivery into a switched-off key writes the new value and leaves the key off.
Change history
Every change to a key is recorded with who made it and what it looked like before and after: creates, updates, deletes, and the kill switch (deactivate / activate). Each entry has action, actor_kind (pat for a developer, server_key, operator, or system for a scheduled content delivery), actor_id, created_at, and before / after snapshots of the value, default value, type, description, conditions, is_active and version. A write that changes nothing records nothing, and a key's history outlives the key.
Both list newest first. limit is 1-200 (default 50); pass the last entry's id as before to read the next page. From an agent: amba_remote_configs_history({ project_id, key? }).
Reading config from server code
A value your server enforces can live in remote config with the rest, segment and percentage rollouts included. A daily rewarded-ad cap is the usual case: the app reads it to show "3 of 5 left", and the function that grants the reward reads the same number to refuse the sixth.
GET /v1/admin/projects/:projectId/config/resolve returns the map Amba.config.fetch() serves a given user. Both routes run the same resolver, so the server and the app always agree: the same segment conditions, the same percentage rollout bucket, the same kill switch, the same value_type coercion.
| Query param | Required | Meaning |
|---|---|---|
app_user_id | no | The app user's id. Omit it for the anonymous view: every key resolves to its default. |
data has the shape the app receives. meta.matches says per key how its value was chosen: default, or condition with the winning entry's position in conditions, its segment_id and its percentage. A key switched off with the kill switch is absent from both, as it is for the app.
An app_user_id that names no user in the project returns 404 USER_NOT_FOUND, so a wrong id fails loudly in code that enforces a limit. A value that is not a UUID returns 400 INVALID_INPUT.
Resolution depends on who the user is: their segment memberships and their rollout bucket. Device details such as platform, app version and locale reach it through segments (a segment can target app_version or OS), so the route takes no device parameters.
In an Amba function, call it with the project-scoped token every function receives:
From an agent: amba_remote_configs_resolve({ project_id, app_user_id? }) shows what one user is served, which is also the quickest way to check a targeting rule.
Setting config values
Via the Admin API
Via MCP
Via the CLI
Routes reference
| Method | Path | Description |
|---|---|---|
GET | /v1/client/config | Fetch config values. Supports If-None-Match → 304. |
POST | /v1/admin/projects/:projectId/config | Create or update a config value |
GET | /v1/admin/projects/:projectId/config | List every key with its is_active |
PATCH | /v1/admin/projects/:projectId/config/:key | Update a key, including is_active (kill switch) |
DELETE | /v1/admin/projects/:projectId/config/:key | Delete a config value |
GET | /v1/admin/projects/:projectId/config/history | Change history for the whole project |
GET | /v1/admin/projects/:projectId/config/:key/history | Change history for one key |
GET | /v1/admin/projects/:projectId/config/resolve | The values one app user is served, for server code |
MCP tools
| Tool | Description |
|---|---|
amba_remote_configs_list | List a project's config keys (values, types, conditions) |
amba_remote_configs_create | Create / upsert a key with optional conditions |
amba_remote_configs_update | Partially update a single key (only fields provided) |
amba_remote_configs_set_active | Kill switch: switch a key off or back on |
amba_remote_configs_history | Who changed which key and when, with before / after |
amba_remote_configs_resolve | The values one app user is served, and which rule matched |
amba_remote_configs_delete | Remove a key |