Hooks

class Hooks(source)

Events fired by ConfigCatClient.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun addOnClientReady(handler: () -> Unit)

This event is sent when the SDK reaches the ready state. If the SDK is configured with lazy load or manual polling it's considered ready right after instantiation. If it's using auto polling, the ready state is reached when the SDK has a valid config.json loaded into memory either from cache or from HTTP. If the config couldn't be loaded neither from cache nor from HTTP the onClientReady event fires when the auto polling's maxInitWaitTimeInSeconds is reached.

Link copied to clipboard

This event is sent when the SDK loads a valid config.json into memory from cache, and each subsequent time when the loaded config.json changes via HTTP.

Link copied to clipboard
fun addOnError(handler: (String) -> Unit)

This event is sent when an error occurs within the SDK.

Link copied to clipboard

This event is sent each time when the SDK evaluates a feature flag or setting. The event sends the same evaluation details that you would get from ConfigCatClient.getValueDetails.