{"id":31807995,"url":"https://github.com/solfacil/feature-flag","last_synced_at":"2025-10-11T04:39:37.685Z","repository":{"id":37673981,"uuid":"453088439","full_name":"solfacil/feature-flag","owner":"solfacil","description":"FeatureFlag abstract the communication with Launch Darkly SDK","archived":false,"fork":false,"pushed_at":"2022-02-01T20:46:11.000Z","size":9,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":40,"default_branch":"main","last_synced_at":"2023-03-05T06:49:25.533Z","etag":null,"topics":["elixir","feature-flags","launchdarkly"],"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/solfacil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-28T14:01:22.000Z","updated_at":"2023-01-25T23:13:32.000Z","dependencies_parsed_at":"2022-09-15T00:50:50.358Z","dependency_job_id":null,"html_url":"https://github.com/solfacil/feature-flag","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/solfacil/feature-flag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solfacil%2Ffeature-flag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solfacil%2Ffeature-flag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solfacil%2Ffeature-flag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solfacil%2Ffeature-flag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solfacil","download_url":"https://codeload.github.com/solfacil/feature-flag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solfacil%2Ffeature-flag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006244,"owners_count":26084061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["elixir","feature-flags","launchdarkly"],"created_at":"2025-10-11T04:39:23.428Z","updated_at":"2025-10-11T04:39:37.680Z","avatar_url":"https://github.com/solfacil.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FeatureFlag\n\nFeatureFlag is project to abstract the communication with [Launch Darkly SDK](https://github.com/launchdarkly/erlang-server-sdk).\n\n## Installation\n\nAdd git repository `feature_flag` in your `mix.exs`:\n\n```elixir\ndefp deps do\n  [\n    ...,\n    # To use newest version\n    {:feature_flag, git: \"https://github.com/solfacil/feature-flag.git\", branch: \"main\"}\n    # To use a specific git tag version\n    {:feature_flag, git: \"https://github.com/solfacil/feature-flag.git\", tag: \"x.x.x\"}\n  ]\nend\n```\n\nFor details about git repository in `deps`, read [Git options](https://hexdocs.pm/mix/1.12/Mix.Tasks.Deps.html#module-git-options-git).\n\n## Usage\n\nA client instance must be started for feature flag evaluation to work. We recommend use `FeatureFlag.Server` to start a client instance on application startup and then feel free to use `FeatureFlag.check/3` function to get feature flag value.\n\n**Below is a suggestion how to use the lib**\n\nUse `config/\u003cenv\u003e.exs` to set the Launch Darkly secret key.\n\n```elixir\nconfig :my_app, :feature_flag, secret_key: \"ld-secret-key\"\n```\n\nAdd `FeatureFlag.Server` to your `MyApp.Application` to start a client instance.\n\n```elixir\ndefmodule MyApp.Application do\n  @moduledoc false\n\n  use Application\n\n  def start(_type, _args) do\n    children = [\n      {FeatureFlag.Server, [secret_key: secret_key()]}\n    ]\n\n    opts = [strategy: :one_for_one, name: MyApp.Supervisor]\n    Supervisor.start_link(children, opts)\n  end\n\n  defp secret_key, do: Application.get_env(:my_app, :feature_flag)[:secret_key]\nend\n```\n\u003e If no `:secret_key` option are given, an error will be thrown.\n\nNow you are ready to go. Use `FeatureFlag.check/3` to evaluate given flag value for given user.\n\n```elixir\niex\u003e user = %FeatureFlag.User{key: \"123abc\", name: \"John\", email: \"john@example.com\"}\niex\u003e FeatureFlag.check(\"admin-report\", user)\ntrue\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolfacil%2Ffeature-flag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolfacil%2Ffeature-flag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolfacil%2Ffeature-flag/lists"}