Unleash v1.1.0 Unleash View Source
If you have no plans on extending the client, then Unleash
will be the main
usage point of the library. Upon starting your app, the client is registered
with the unleash server, and two GenServer
s are started, one to fetch and
poll for feature flags from the server, and one to send metrics.
Configuring :disable_client
to true
disables both servers as well as
registration, while configuring :disable_metrics
to true
disables only
the metrics GenServer
.
Link to this section Summary
Types
The context needed for a few activation strategies. Check their documentation for the required key.
Functions
Checks if the given feature is enabled. Checks as though an empty context was passed in.
Checks if the given feature is enabled.
Aliased to enabled?/2
Link to this section Types
The context needed for a few activation strategies. Check their documentation for the required key.
:user_id
is the ID of the user interacting with your system, can be anyString.t()
session_id
is the ID of the current session in your system, can be anyString.t()
remote_address
is the address of the user interacting with your system, can be anyString.t()
Link to this section Functions
Checks if the given feature is enabled. Checks as though an empty context was passed in.
Examples
iex> Unleash.enabled?(:my_feature, false)
false
iex> Unleash.enabled?(:my_feature, true)
true
Checks if the given feature is enabled.
If :disable_client
is true
, simply returns the given default
.
If :disable_metrics
is true
, nothing is logged about the given toggle.
Examples
iex> Unleash.enabled?(:my_feature)
false
iex> Unleash.enabled?(:my_feature, context)
false
iex> Unleash.enabled?(:my_feature, context, true)
false
Aliased to enabled?/2
Aliased to enabled?/3