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.
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
}'kindisremote_config;payloads.defaultis any JSON value.encrypt_payload: trueseals the payload at rest. Only secret keys see the plaintext, and it cannot be copied to another project. Onlyremote_configflags 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 undefinedReact: 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"); // Nodelimits = client.get_remote_config_payload("checkout-limits") # Pythonlimits, ok, err := client.GetRemoteConfigPayload(ctx, "checkout-limits") // GoOver 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.