Platform
Remote Config
Tested with:Beta on Databasezy · Databasezy API v1
Remote Config lets you change what your apps do without shipping a new build: a welcome message, a limit, a feature flag, a JSON blob of settings. You keep a template of parameters and conditions in the project; your apps fetch it from the project endpoint and receive only the values that apply to them. Conditions are evaluated on the server, so a client never sees another audience’s values, the other conditions or their names.
Use the exact endpoint from Project settings, including its region, custom domain and public port. The host and port below are placeholders.
How it works
Section titled “How it works”-
Turn it on for the project: Platform services → Remote Config (the switch),
zb config enable, orPUT /v1/orgs/{org}/projects/{project}/remote-config {"enabled": true}. That openshttps://<ref>.us-east.databasezy.com:8443/remote-config/v1/fetch. -
Edit the draft: add parameters and conditions. Every save checks the whole template; a malformed condition or a value that does not match its type is refused (422) and never evaluated. Each save carries the draft revision you read, so a teammate’s concurrent edit is a 409 instead of a lost update.
-
Publish. The draft becomes a new, immutable version with a diff against the previous one; the project’s cell serves it within seconds. Nothing reaches apps before you publish.
-
Your apps fetch at start-up (and whenever you like), cache the values and send the
ETagback to get304 Not Modifiedwhen nothing changed.
To undo a release, roll back to any earlier version: its exact template is published again as one more version (versions are never deleted) and the draft is reset to it.
Parameters
Section titled “Parameters”| Field | |
|---|---|
key | Letters, digits and _, starting with a letter or _; up to 256 characters; unique |
value_type | string, number, boolean or json |
default_value | What apps get when no condition matches, as text valid for the type (10, true, {"accent":"blue"}) |
conditional_values | [{"condition": "<name>", "value": "..."}]: the value while a condition matches |
description | For your team; never sent to apps |
A parameter takes the value of the first matching condition in priority order among its conditional values,
otherwise its default. Fetched values are JSON of their type: "Hello", 10, true, {"accent": "blue"}.
A template has at most 2 000 parameters and 500 conditions, 256 KiB in total; one value is at most 64 KiB.
Conditions
Section titled “Conditions”A condition has a name (a letter, then letters, digits, _ or -; up to 64), a priority (1 to 500, unique; 1 is
evaluated first) and an expression:
app.platform == 'ios' && app.version >= '3.0.0'percent < 10percent('checkout-2026') between 10 and 20device.country in ['DE', 'FR', 'NL']user.claims.app_metadata.plan == 'pro' || attr.beta == true!(user.role == 'anon')| Value | From | Notes |
|---|---|---|
app.version | client | Compared as a dotted version: 2.10.1 >= '2.9'. Ordering needs a version string |
app.platform | client | ios, android, web, macos, windows, linux, other (case-insensitive) |
app.id | client | Bundle or package id |
device.language, device.country | client | BCP 47 tag, ISO 3166-1 alpha-2 code (case-insensitive) |
attr.<name> | client | A custom attribute (string, number or boolean) |
user.id, user.role | verified token | Present only when the fetch carries an end-user access token |
user.claims.<path> | verified token | Any claim of the token, up to four levels (user.claims.app_metadata.plan) |
percent | server | The install’s stable bucket, 0 to 100 (see below) |
Operators: ==, !=, <, <=, >, >=, in [..] (up to 100 values), &&, ||, ! and parentheses.
Literals are 'strings' or "strings" (up to 256 characters; \' and \\ escapes), numbers, true and false.
A value that is missing makes its comparison false (so !(attr.x == 'y') is true when attr.x is absent). An
expression has at most 2 048 characters, 64 terms and 12 levels of nesting.
Percentage rollouts
Section titled “Percentage rollouts”percent is a number from 0 up to (not including) 100, with four decimals, computed on the server from the project,
an optional seed and the client’s install_id (or, without one, the signed-in user’s id): the same install always
lands in the same bucket, so a rollout reaches the same people on every fetch. A client cannot choose its bucket:
percent is not a context field, and unknown fields are refused.
percent < 10targets 10 % of installs;percent between 10 and 20the next 10 % (the lower bound is inclusive, the upper exclusive), so splits never overlap.- Conditions without a seed share the project’s bucket.
percent('my-experiment') < 50uses its own seed, which reshuffles installs independently of other rollouts. - Without an
install_idand without a signed-in user, percentage conditions never match.
Fetching
Section titled “Fetching”GET or POST https://<ref>.us-east.databasezy.com:8443/remote-config/v1/fetch with the project’s publishable key (in
browsers and apps), optionally with the signed-in user’s access token so user.* conditions apply, or with a
secret key from a server.
| Context field | Rule |
|---|---|
install_id | 8 to 128 letters, digits, _, ., : or -; keep it stable per install |
app_version | A dotted version (3.1.0, 2.0.0-beta.1) |
platform | One of the platforms above |
app_id, language, country | As above |
attributes | Up to 50 name: value pairs (POST only); names like attr. names, strings up to 256 characters |
The body (POST) or the query string (GET) carries the context; any other field is refused (400). The answer:
{ "version": 7, "values": { "welcome": "Hello", "max_items": 10, "new_checkout": true } }with an ETag header: send it back as If-None-Match and an unchanged result is 304 with no body. version 0 means
nothing is published yet (values is empty). A project with Remote Config off answers 404.
const res = await fetch(`${DATABASEZY_URL}/remote-config/v1/fetch`, { method: "POST", headers: { apikey: DATABASEZY_PUBLISHABLE_KEY, // After sign-in, so user.* conditions apply: ...(session ? { Authorization: `Bearer ${session.access_token}` } : {}), "Content-Type": "application/json", "If-None-Match": cached?.etag ?? "", }, body: JSON.stringify({ install_id: installId, platform: "web", app_version: "3.1.0", attributes: { beta: true } }),});if (res.status === 200) { cached = { etag: res.headers.get("ETag"), ...(await res.json()) };}const showNewCheckout = cached.values.new_checkout === true;// Reuse the session of supabase-js (pointed at your project endpoint):const { data: { session } } = await supabase.auth.getSession();const res = await fetch(`${SUPABASE_URL}/remote-config/v1/fetch`, { method: "POST", headers: { apikey: SUPABASE_ANON_KEY, Authorization: `Bearer ${session?.access_token ?? SUPABASE_ANON_KEY}` }, body: JSON.stringify({ install_id: installId, platform: "web" }),});const { values } = await res.json();var req = URLRequest(url: URL(string: "\(baseURL)/remote-config/v1/fetch")!)req.httpMethod = "POST"req.setValue(publishableKey, forHTTPHeaderField: "apikey")req.setValue("application/json", forHTTPHeaderField: "Content-Type")req.httpBody = try JSONEncoder().encode(["install_id": installID, "platform": "ios", "app_version": appVersion])let (data, _) = try await URLSession.shared.data(for: req)curl -s "https://<ref>.us-east.databasezy.com:8443/remote-config/v1/fetch?install_id=install-0001&platform=android&app_version=3.1.0" \ -H "apikey: $DATABASEZY_PUBLISHABLE_KEY"Each install (or, without an install_id, each address) may fetch 60 times a minute (30 on Free cells); more is
429 with Retry-After. Fetch at start-up and on resume, not in a loop.
Manage it
Section titled “Manage it”zb config enablezb config conditions set ios_new "app.platform == 'ios' && app.version >= '3.0.0'"zb config set welcome "Hello" --when ios_new="Hello iOS"zb config set new_checkout false --type booleanzb config get --platform ios --app-version 3.1.0 --draft # preview the draftzb config publish --description "new welcome"zb config versionszb config rollback 3zb config export template.json # and: zb config import template.json| Request | |
|---|---|
GET …/projects/{project}/remote-config | Status, the draft template and its draft_revision, the published version |
PUT …/remote-config {"enabled": true} | Open or close the fetch endpoint |
PUT …/remote-config/template | Replace the draft: {"parameters": [...], "conditions": [...], "base_revision": 4} |
POST …/remote-config/publish | Publish ({"description": "...", "base_revision": 5}); 409 when nothing changed |
GET …/remote-config/versions, …/versions/{v} | Versions with their diff (and template) |
POST …/remote-config/versions/{v}/rollback | Publish version v again as a new version |
POST …/remote-config/evaluate | Preview a fetch: {"context": {...}, "user": {"id": "...", "claims": {...}}, "draft": true} |
Reading needs remote_config:read; editing, publishing and rolling back need remote_config:write (developers,
admins and owners; viewers read). Every change is in the audit log; enabling, publishing and rolling back are also
security events. The project endpoint itself never changes a template: write methods there are refused (403) whatever
the key.
Usage and pricing
Section titled “Usage and pricing”Every fetch (a 304 included) is metered as remote_config_fetches and shown with your project’s usage. Each plan
includes a monthly allowance of fetches for the whole organization (Free 3,100,000, Solo 3,100,000, Team 3,100,000; Enterprise by contract): Firebase
Remote Config’s 100,000 free fetches a day, counted over a 31-day month. Above it a fetch costs
$0.000006 ($0.06 per 10,000), Firebase’s rate, on the same invoice
as the rest of your usage. Past 310,000,000 fetches in the month the price drops to $0.000001 ($0.01 per 10,000): Firebase charges that lower price above 10 million fetches a day per project, which we count over a 31-day month for the whole organization. The month's fetches are counted in order, the included ones first.
On Free, and on a paid plan with the spend cap on, fetches above the allowance are never billed and never refused, so your apps never fall back to stale values because of a quota. You are notified at 80%, 90% and 100% of the allowance, and the per-install rate limit above keeps one client from using it up. Response bytes count toward the plan’s egress allowance like every other platform response.