Dynamic configs
A dynamic config is a typed JSON value (string, number, bool, array, or object) fetched by name from the cached /sdk/evaluate response.
/docs/ — also served raw at https://shipeasy-ai.github.io/sdk-swift/pages/configs.md.A dynamic config is a typed JSON value (string, number, bool, array, or object)
fetched by name from the cached /sdk/evaluate response.
let client = shipeasyClient()!
await client.identify(["user_id": "u_123"])
let copy = await client.getConfig("billing_copy")
// copy is `Any?` — cast to your expected shape:
let headline = (copy as? [String: Any])?["headline"] as? StringgetConfig returns nil when the key is absent (or the assignments aren't
loaded yet).
Default value
Pass default to get a value back when the config key is absent:
let copy = await client.getConfig("billing_copy", default: ["headline": "Welcome"])Typed reads
Because the returned value is Any?, cast it with as? to the shape your config
defines:
let maxItems = (await client.getConfig("cart_limit")) as? Int ?? 10
let banner = (await client.getConfig("banner_text")) as? String
let theme = (await client.getConfig("theme")) as? [String: Any]
let accent = theme?["accent"] as? StringFlags
A flag (a.k.a. gate) evaluates to a Bool for the identified device user. Reads are served from the local cache of the last /sdk/evaluate response — no…
Kill switches
A kill switch reports whether a panic/disable switch is engaged. It returns a Bool — true means the switch is on (the thing it guards is killed). The value…