Install
Initialize
Create a client with a client key (slc_). init returns immediately and starts loading in the background.
waitUntilReady:
Read a flag
Each flag type has a method. Pass the flag key, a subject key, attributes, and a default value.getBooleanFlag(flagKey, subjectKey, attributes, defaultValue)getStringFlag(flagKey, subjectKey, attributes, defaultValue)getIntegerFlag(flagKey, subjectKey, attributes, defaultValue)getNumericFlag(flagKey, subjectKey, attributes, defaultValue)getJsonFlag<T>(flagKey, subjectKey, attributes, defaultValue)
React to changes
The client stays subscribed after the first load. Usesubscribe to run code whenever flag values may have changed — re-read the flags you care about inside the listener.
Check status
getStatus reports the current load state as a discriminated union:
Clean up
Callclose to tear down the subscription and release resources when the client is no longer needed.
Reads always return a value — your default until the configuration loads, and the resolved variation once it’s ready. You never need to guard a read against an unready client.