Remote config: flag payloads as JSON settings

Create a remote_config flag, store a JSON payload (optionally encrypted), and read it from the browser, Node, Python and Go SDKs.

Embed
Preview of the card
<a href="https://lucidace.com/help/remote-config"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/f40c074d-15e5-4bbb-b643-6b709ef4ef76/social-card.svg?v=3e7ae33eec8b" alt="Remote config: flag payloads as JSON settings" width="600" height="315"></a>

A remote_config flag is a feature flag whose job is to hold JSON. You change settings (limits, copy, URLs, thresholds) in Lucida and every app reads the new value without a deploy. Because it is a flag, it also has targeting, so different people can get different payloads.

Create one

curl -X POST "https://<your app host>/v1/projects/$PROJECT/flags" \
  -H "Authorization: Bearer $LUCIDA_KEY" -H "Content-Type: application/json" \
  -d '{
    "key": "checkout-limits",
    "kind": "remote_config",
    "enabled": true,
    "payloads": {"default": {"max_items": 20, "banner": "Free shipping over $50"}},
    "encrypt_payload": false
  }'
  • kind is remote_config; payloads.default is any JSON value.

  • encrypt_payload: true seals the payload at rest. Only secret keys see the plaintext, and it cannot be copied to another project. Only remote_config flags can be encrypted.

  • The flag's key may use letters, digits, _, - and ., up to 100 characters.

Read it

Browser (public key). The payload arrives with the flags. Do not use it for secrets: a public key can read it.

const limits = lucida.getFlagPayload("checkout-limits");   // the JSON, or undefined

React: useFeatureFlagPayload("checkout-limits"). Server rendering can pass bootstrap: { flags, payloads } to init so the value is there on the first paint.

Node (secret key), by targeting. Evaluates for one person, so targeting applies:

const limits = await lucida.getFeatureFlagPayload("checkout-limits", "user_123");

Node, Python and Go, without targeting (secret key). Reads the payload of one remote-config flag directly and opens encrypted payloads. It needs a secret key; the Node call throws without one.

const limits = await lucida.getRemoteConfigPayload("checkout-limits");        // Node
limits = client.get_remote_config_payload("checkout-limits")                  # Python
limits, ok, err := client.GetRemoteConfigPayload(ctx, "checkout-limits")      // Go

Over HTTP this is GET /v1/flags/{key}/remote-config on the capture host with Authorization: Bearer <secret key>. It answers {key, enabled, payload}, 404 for an unknown key or a flag that is not remote_config, and 503 for an encrypted payload when the gateway has no LC_MASTER_KEY.

Per-person payloads over HTTP come from POST /v1/flags (payload per flag), see Evaluate flags over HTTP.

Updated