ldclient
module.
ldclient
module
all_flags_state/1 | Evaluate all flags for a given user and return their values. |
all_flags_state/2 | Evaluate all flags for a given user and given client instance. |
identify/1 | Identify reports details about a user. |
identify/2 | Identify reports details about a user. |
initialized/1 | Returns whether the LaunchDarkly client has initialized. |
is_offline/1 | Returns whether the LaunchDarkly client is in offline mode. |
start_instance/1 | Start client with default options. |
start_instance/2 | Start client with custom name or options. |
start_instance/3 | Start client with custom name and options. |
stop_all_instances/0 | Stop all client instances. |
stop_instance/0 | Stop client instance. |
stop_instance/1 | Stop client with the custom name. |
track/3 | Track reports that a user has performed an event. |
track/4 | Track reports that a user has performed an event. |
track_metric/4 | Reports that a user has performed an event, and associates it with a numeric value. |
track_metric/5 | Reports that a user has performed an event, and associates it with a numeric value. |
variation/3 | Evaluate given flag key for given user. |
variation/4 | Evaluate given flag key for given user and given client instance. |
variation_detail/3 | Evaluate given flag key for given user. |
variation_detail/4 | Evaluate given flag key for given user and given client instance. |
all_flags_state(User::ldclient_user:user()) -> ldclient_eval:feature_flags_state()
Evaluate all flags for a given user and return their values
Evaluates all existing flags, but does not create any events as a side effect of the evaluation. It returns a map of flag keys to evaluated values.all_flags_state(User::ldclient_user:user(), Tag::atom()) -> ldclient_eval:feature_flags_state()
Evaluate all flags for a given user and given client instance
Evaluates all existing flags, but does not create any events as a side effect of the evaluation. It returns a map of flag keys to evaluated values.identify(User::ldclient_user:user()) -> ok
Identify reports details about a user
This function uses the default client instance.identify(User::ldclient_user:user(), Tag::atom()) -> ok
Identify reports details about a user
This is useful to report user to a specific client instance.initialized(Tag::atom()) -> boolean()
Returns whether the LaunchDarkly client has initialized.
If this value is true, it means the client has succeeded at some point in connecting to LaunchDarkly and has received feature flag data. It could still have encountered a connection problem after that point, so this does not guarantee that the flags are up to date. Alternatively, it could also mean that the client is in offline mode.
If this value is false, it means the client has not yet connected to LaunchDarkly, or has permanently failed. In this state, feature flag evaluations will always return default values.is_offline(Tag::atom()) -> boolean()
Returns whether the LaunchDarkly client is in offline mode.
In some situations, you might want to stop making remote calls to LaunchDarkly and fall back to default values for your feature flags, this tells you whether only default values will be returned.start_instance(SdkKey::string()) -> ok | {error, atom(), term()}
Start client with default options
The SDK key is required to connect. Default streamer URL, storage backend and instance namedefault
will be used.
start_instance(SdkKey::string(), TagOrOptions::atom() | map()) -> ok | {error, atom(), term()}
Start client with custom name or options
WhenTagOrOptions
is an atom, the instance is started with that name. When
it's a map, it can be used to start with custom options.
start_instance(SdkKey::string(), Tag::atom(), Options::map()) -> ok | {error, atom(), term()}
Start client with custom name and options
Specify both custom client name and options when starting the client.stop_all_instances() -> ok
Stop all client instances
stop_instance() -> ok | {error, not_found, term()}
Stop client instance
Stops the default client instance.stop_instance(Tag::atom()) -> ok | {error, not_found, term()}
Stop client with the custom name
This is useful if a client instance was started with a custom name.track(Key::binary(), User::ldclient_user:user(), Data::map()) -> ok
Track reports that a user has performed an event
Custom data can be attached to the event.track(Key::binary(), User::ldclient_user:user(), Data::map(), Tag::atom()) -> ok
Track reports that a user has performed an event
This is useful for specifying a specific client instance.track_metric(Key::binary(), User::ldclient_user:user(), Data::map(), Metric::number()) -> ok
Reports that a user has performed an event, and associates it with a numeric value.
This value is used by the LaunchDarkly experimentation feature in numeric custom metrics, and will also be returned as part of the custom event for Data Export.
Custom data can also be attached to the event.track_metric(Key::binary(), User::ldclient_user:user(), Data::map(), Metric::number(), Tag::atom()) -> ok
Reports that a user has performed an event, and associates it with a numeric value.
This value is used by the LaunchDarkly experimentation feature in numeric custom metrics, and will also be returned as part of the custom event for Data Export.
Custom data can also be attached to the event.variation(FlagKey::binary(), User::ldclient_user:user(), DefaultValue::ldclient_eval:result_value()) -> ldclient_eval:result_value()
Evaluate given flag key for given user
Evaluates the flag and returns the resulting variation value. The default value will be returned in case of any errors.variation(FlagKey::binary(), User::ldclient_user:user(), DefaultValue::ldclient_eval:result_value(), Tag::atom()) -> ldclient_eval:result_value()
Evaluate given flag key for given user and given client instance
Evaluates the flag and returns the resulting variation value. The default value will be returned in case of any errors.variation_detail(FlagKey::binary(), User::ldclient_user:user(), DefaultValue::ldclient_eval:result_value()) -> ldclient_eval:detail()
Evaluate given flag key for given user
Evaluates the flag and returns the result detail containing the variation index, value, and reason why the specific result was chosen. The default value will be returned in case of any errors.variation_detail(FlagKey::binary(), User::ldclient_user:user(), DefaultValue::ldclient_eval:result_value(), Tag::atom()) -> ldclient_eval:detail()
Evaluate given flag key for given user and given client instance
Evaluates the flag and returns the result detail containing the variation index, value, and reason why the specific result was chosen. The default value will be returned in case of any errors.Generated by EDoc