{"id":33901115,"url":"https://github.com/primait/ex-launch-dark","last_synced_at":"2026-01-19T13:00:31.181Z","repository":{"id":327374443,"uuid":"1070624264","full_name":"primait/ex-launch-dark","owner":"primait","description":"Elixir Launch Darkly integration lib","archived":false,"fork":false,"pushed_at":"2026-01-12T10:59:18.000Z","size":23,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-12T18:53:51.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primait.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T08:03:16.000Z","updated_at":"2026-01-12T10:52:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/primait/ex-launch-dark","commit_stats":null,"previous_names":["primait/ex-launch-dark"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/primait/ex-launch-dark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fex-launch-dark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fex-launch-dark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fex-launch-dark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fex-launch-dark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primait","download_url":"https://codeload.github.com/primait/ex-launch-dark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primait%2Fex-launch-dark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28568833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-11T23:48:20.171Z","updated_at":"2026-01-19T13:00:31.169Z","avatar_url":"https://github.com/primait.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExLaunchDark\n\nElixir Launch Darkly integration library\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `ex_launch_dark` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_launch_dark, \"~\u003e 0.1.0\"},\n    # or using git source\n    {:ex_launch_dark, git: \"url_to_repo\", tag: \"1.1.0\"}\n  ]\nend\n```\n\n## Configuration\n\nThe client requires a Launch Darkly SDK key to connect to the service.\nYou can get this key from your Launch Darkly account.\n\nThen in the host application configuration file, typically `config/config.exs` or `config/runtime.exs`, add:\n\n```elixir\n# List all project keys to be used\nconfig :ex_launch_dark, :projects, [:project_key_1, :project_key_n]\n# Defined shared url among all different project clients\nconfig :ex_launch_dark, :base_uri, \"https://app.launchdarkly.com\"   \n# For each project, add its own SDK key\nconfig :ex_launch_dark, :project_key_1, \"sdk-xxxxx-yyyyy-zzzzzzz-11111\"\nconfig :ex_launch_dark, :project_key_n, \"sdk-xxxxx-yyyyy-zzzzzzz-22222\"\n```\n\n## Usage\n\nTo start using the library main functions you can start playing with the `ExLaunchDark.LDAdapter` module.\nWhich exposes some of the most common flag operations, like:\n\n```elixir\n# Retrieve the current value of any given feature flag \n\nld_ctx = %ExLaunchDark.LDContextStruct{key: \"ctx_key_123\", kind: \"user\"}\n\ncase ExLaunchDark.LDAdapter.get_feature_flag_value(:project_key_1, \"flag_foo\", ld_ctx, false) do\n  {:ok, value, _reason} -\u003e \n    # All good, use the value\n  {:error, _default, reason} -\u003e \n    # Something went wrong, handle the error using given reason\nend\n\n# Retrieve the current value of a feature flag using a multi-context\n# (e.g. application + user in a single evaluation)\n\napp_ctx =\n  %ExLaunchDark.LDContextStruct{\n    key: \"my_app_backend\",\n    kind: \"service\",\n    attributes: %{}\n  }\n\nuser_ctx =\n  %ExLaunchDark.LDContextStruct{\n    key: \"user_123\",\n    kind: \"user\",\n    attributes: %{\n      \"country\" =\u003e \"uk\",\n      \"roles\" =\u003e [\"admin\"]\n    }\n  }\n\nmulti_ctx =\n  %ExLaunchDark.LDMultiContextStruct{\n    contexts: [app_ctx, user_ctx]\n  }\n\ncase ExLaunchDark.LDAdapter.get_feature_flag_value(\n       :project_key_1,\n       \"flag_foo\",\n       multi_ctx,\n       false\n     ) do\n  {:ok, value, _reason} -\u003e\n    # All good, use the value\n  {:error, _default, reason} -\u003e\n    # Something went wrong, handle the error using given reason\nend\n```\n\nNOTE: Elixir generally prefers underscores rather than hypens (e.g. \"flag_foo\" rather than \"flag-foo\") but Launchdarkly idioms prefer hyphens. `ExLaunchDark.LDAdapter.get_feature_flag_value` makes no assumptions nor enforcement\nof this. If you want to use the Launchdarkly style for your `flag_key` then use `ExLaunchDark.LDAdapter.normalise` first.\n\n## In-memory adapter (testing \u0026 local development)\n\nFor testing or local development, the library provides an in-memory adapter\nbased on ETS:\n\n`ExLaunchDark.InMemoryAdapter`\n\nThis adapter implements the same interface as `ExLaunchDark.LDAdapter`, but\nstores feature flag overrides in memory.\n\n⚠️ **Do not use this adapter in production.**\nData stored in ETS is lost on application restart and is local to a single node.\n\n### Example usage\n\n```elixir\n# Enable the in-memory adapter in your application config (compile time)\nconfig :my_app, :feature_flags_adapter, ExLaunchDark.InMemoryAdapter\n\n# Override a flag value\nExLaunchDark.InMemoryAdapter.enable(\"example-feature-flag\")\n\n# Disable a flag\nExLaunchDark.InMemoryAdapter.disable(\"example-feature-flag\")\n\n# Clear all overrides\nExLaunchDark.InMemoryAdapter.clear_flags()\n```\n\nExternally defined adapters must implement the `ExLaunchDark.Adapter` behaviour, which defines the\n`get_feature_flag_value/4` callback used for flag evaluation.\n\n## Development\n\nIn order run this project isolated, you need to ensure you have first installed manually the ``asdf``\ntool manager in your host machine, then run:\n\n```bash\nasdf install\n```\n\nwhich will install the required Erlang and Elixir versions as specified in the `.tool-versions` file.\n\nThen you can fetch the dependencies with:\n\n```bash\nmix deps.get\nmix deps.compile\n```\n\n### Application commands\n\nIn order to ease some of the common development tasks, you can use any of the \"commands/tasks\"\ndefined in the `mise.toml` file, like:\n\n```bash\nmise start \nmise test\nmise code:check \nmise code:format\n```\n\n## Release\n\n### Bump the new version and push to GH\n\nTo bump the version in the `mix.exs` file run one of the following:\n\n```bash\nmix bump patch\nmix bump minor\nmix bump major\n```\n\nThis can be done on the current branch/PR or, if the PR is particularly complex or there are multiple PRs, create a new branch for a new release.\n\n### Perform the actual release\n\nThis project isn't integrated with `suite-py` yet so the release must be created manually:\n\n1. Go to https://github.com/primait/ex-launch-dark/releases\n2. Click \"Draft a new release\"\n3. Create a new tag that is the new version (e.g. if the new version is 1.1.3 then the tag is called \"1.1.3\")\n4. Create the release\n\nThis will then kick off the build-and-release-to-hex workflow.\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/ex_launch_dark](https://hexdocs.pm/ex_launch_dark).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimait%2Fex-launch-dark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimait%2Fex-launch-dark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimait%2Fex-launch-dark/lists"}