Skip to content

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.

  1. Turn it on for the project: Platform services → Remote Config (the switch), zb config enable, or PUT /v1/orgs/{org}/projects/{project}/remote-config {"enabled": true}. That opens https://<ref>.us-east.databasezy.com:8443/remote-config/v1/fetch.

  2. 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.

  3. 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.

  4. Your apps fetch at start-up (and whenever you like), cache the values and send the ETag back to get 304 Not Modified when 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.

Field
keyLetters, digits and _, starting with a letter or _; up to 256 characters; unique
value_typestring, number, boolean or json
default_valueWhat 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
descriptionFor 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.

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 < 10
percent('checkout-2026') between 10 and 20
device.country in ['DE', 'FR', 'NL']
user.claims.app_metadata.plan == 'pro' || attr.beta == true
!(user.role == 'anon')
ValueFromNotes
app.versionclientCompared as a dotted version: 2.10.1 >= '2.9'. Ordering needs a version string
app.platformclientios, android, web, macos, windows, linux, other (case-insensitive)
app.idclientBundle or package id
device.language, device.countryclientBCP 47 tag, ISO 3166-1 alpha-2 code (case-insensitive)
attr.<name>clientA custom attribute (string, number or boolean)
user.id, user.roleverified tokenPresent only when the fetch carries an end-user access token
user.claims.<path>verified tokenAny claim of the token, up to four levels (user.claims.app_metadata.plan)
percentserverThe 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.

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 < 10 targets 10 % of installs; percent between 10 and 20 the 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') < 50 uses its own seed, which reshuffles installs independently of other rollouts.
  • Without an install_id and without a signed-in user, percentage conditions never match.

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 fieldRule
install_id8 to 128 letters, digits, _, ., : or -; keep it stable per install
app_versionA dotted version (3.1.0, 2.0.0-beta.1)
platformOne of the platforms above
app_id, language, countryAs above
attributesUp 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;

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.

Terminal window
zb config enable
zb 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 boolean
zb config get --platform ios --app-version 3.1.0 --draft # preview the draft
zb config publish --description "new welcome"
zb config versions
zb config rollback 3
zb config export template.json # and: zb config import template.json

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.

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.