Remote Config
Feature flags and dynamic configuration with segment-based conditions and percentage rollouts.
Remote config lets you change app behavior without shipping an update. Set key / value pairs on the server, attach optional per-segment or percentage-rollout conditions, and the SDK fetches them with built-in TTL caching and ETag support.
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 conditions that override the default for specific segments or a percentage of users. - The client SDK fetches the resolved map from
GET /client/config, caches it in your storage, and refreshes on a TTL or onrefresh()call. - ETags +
If-None-Matchkeep refreshes cheap — a 304 response tells the SDK to reuse the cached payload and just bump the timestamp. - Server-side version hashes make change detection fast: flipping a value bumps
config_versions.version_hash, invalidating every client cache.
SDK usage
Method signatures:
Get a single value
Because the value is typed as unknown, cast to your expected type. Always provide a default:
Get the full config map
Force refresh
Expo
The Expo wrapper exposes the module as configModule (not config) because config collides with common React prop / state naming. Note: Amba.init() already calls restore() and a background refresh() for you — your first read is served from the cache.
Manual refresh in Expo
Conditional values
A single config key can return different values to different users. Conditions are evaluated on the server and resolved into a single payload the SDK sees as flat key → value.
Example schema stored in remote_configs.conditions:
This sets the default to false, enables it for all members of seg_power_users, and rolls it out to 25% of everyone else.
Setting config values
Via the Admin API
Via MCP
Via the CLI
Routes reference
| Method | Path | Description |
|---|---|---|
GET | /client/config | Fetch resolved config. Supports If-None-Match → 304. |
POST | /admin/projects/:projectId/config | Create or update a config value |
GET | /admin/projects/:projectId/config | List all active config values |
PATCH | /admin/projects/:projectId/config/:key | Update a specific config |
DELETE | /admin/projects/:projectId/config/:key | Delete a config value |
MCP tools
| Tool | Description |
|---|---|
amba_get_config | Read a specific key for a project |
amba_set_config | Create / update a key with optional conditions |
Database tables
| Table | Purpose |
|---|---|
remote_configs | Key / value / type / conditions / default_value per key |
config_versions | Single-row version_hash that bumps on every change. Used for ETag. |