Skip to content

orbit-apps/elixir-launchdarkly

Repository files navigation

ExLaunchDarkly

A quick Elixir wrapper around the official LaunchDarkly Erlang library

Installation

def deps do
  [
    {:ex_launch_darkly, github: "pixelunion/elixir-launchdarkly", tag: "v0.4.0"}
  ]
end

Usage

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)

Testing

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
  }
)

About

Elixir wrapper around the LaunchDarkly Erlang library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages