Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orbit-apps/elixir-launchdarkly
Elixir wrapper around the LaunchDarkly Erlang library
https://github.com/orbit-apps/elixir-launchdarkly
library
Last synced: 2 months ago
JSON representation
Elixir wrapper around the LaunchDarkly Erlang library
- Host: GitHub
- URL: https://github.com/orbit-apps/elixir-launchdarkly
- Owner: orbit-apps
- License: apache-2.0
- Created: 2019-08-16T19:27:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T14:29:56.000Z (3 months ago)
- Last Synced: 2024-11-05T15:34:20.484Z (3 months ago)
- Topics: library
- Language: Elixir
- Size: 134 KB
- Stars: 4
- Watchers: 16
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ExLaunchDarkly
A quick Elixir wrapper around the official LaunchDarkly [Erlang library](https://github.com/launchdarkly/erlang-server-sdk)
## Installation
```elixir
def deps do
[
{:ex_launch_darkly, github: "pixelunion/elixir-launchdarkly", tag: "v0.4.0"}
]
end
```## Usage
Start your connection to LaunchDarkly on Application start.
```elixir
ExLaunchDarkly.App.start(Application.fetch_env!(:your_application, :launchdarkly_api_key))
```Retrieve a variation.
```elixir
ExLaunchDarkly.variation("Some-Flag", ExLaunchDarkly.User.new("SomeUser"), false)
```## Testing
You can configure LaunchDarkly to only use a [test data source](https://docs.launchdarkly.com/sdk/features/test-data-sources#erlang):
```elixir
ExLaunchDarkly.App.start(
"fake-key",
:default,
%{
datasource: :testdata,
send_events: false,
feature_store: :ldclient_storage_map
}
)
```