A quick Elixir wrapper around the official LaunchDarkly Erlang library
def deps do
[
{:ex_launch_darkly, github: "pixelunion/elixir-launchdarkly", tag: "v0.4.0"}
]
end
Start your connection to LaunchDarkly on Application start.
ExLaunchDarkly.App.start(Application.fetch_env!(:your_application, :launchdarkly_api_key))
Retrieve a variation.
ExLaunchDarkly.variation("Some-Flag", ExLaunchDarkly.User.new("SomeUser"), false)
You can configure LaunchDarkly to only use a test data source:
ExLaunchDarkly.App.start(
"fake-key",
:default,
%{
datasource: :testdata,
send_events: false,
feature_store: :ldclient_storage_map
}
)