{"id":13507908,"url":"https://github.com/sorentwo/flippant","last_synced_at":"2025-04-12T18:45:54.973Z","repository":{"id":10163416,"uuid":"58991612","full_name":"sorentwo/flippant","owner":"sorentwo","description":":traffic_light: Feature flipping for the Elixir world","archived":false,"fork":false,"pushed_at":"2025-03-10T13:55:41.000Z","size":288,"stargazers_count":107,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T02:58:33.183Z","etag":null,"topics":["elixir","feature-toggle"],"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/sorentwo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2016-05-17T04:57:10.000Z","updated_at":"2025-03-10T13:55:43.000Z","dependencies_parsed_at":"2023-01-13T15:46:41.397Z","dependency_job_id":"e74fb8c4-d4cb-405b-a0c8-0a6afb4f52d0","html_url":"https://github.com/sorentwo/flippant","commit_stats":{"total_commits":240,"total_committers":6,"mean_commits":40.0,"dds":0.6208333333333333,"last_synced_commit":"87d24a6b350f4c5fb6c218ac80ef267e5744be4e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorentwo%2Fflippant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorentwo%2Fflippant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorentwo%2Fflippant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorentwo%2Fflippant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorentwo","download_url":"https://codeload.github.com/sorentwo/flippant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248617440,"owners_count":21134191,"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","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-toggle"],"created_at":"2024-08-01T02:00:42.596Z","updated_at":"2025-04-12T18:45:54.952Z","avatar_url":"https://github.com/sorentwo.png","language":"Elixir","funding_links":[],"categories":["Feature Flags and Toggles"],"sub_categories":[],"readme":"# Flippant\n\n[![Build Status](https://travis-ci.org/sorentwo/flippant.svg?branch=master)](https://travis-ci.org/sorentwo/flippant)\n[![Coverage Status](https://coveralls.io/repos/github/sorentwo/flippant/badge.svg?branch=master)](https://coveralls.io/github/sorentwo/flippant?branch=master)\n[![Hex version](https://img.shields.io/hexpm/v/flippant.svg \"Hex version\")](https://hex.pm/packages/flippant)\n[![Inline docs](https://inch-ci.org/github/sorentwo/flippant.svg)](https://inch-ci.org/github/sorentwo/flippant)\n\n\u003e Flippant is a library for feature toggling in Elixir applications\n\n## Installation\n\n1. Add `flippant` to your list of dependencies in `mix.exs`:\n\n  ```elixir\n  def deps do\n    [{:flippant, \"~\u003e 2.0\"}]\n  end\n  ```\n\n2. Add an adapter such as `redix` for Redis or `postgrex` for Postgres:\n\n  ```elixir\n  def deps do\n    [{:redix, \"~\u003e 1.0\"}]\n  end\n  ```\n\n3. Set an adapter within your `config.exs`:\n\n  ```elixir\n  config :flippant,\n         adapter: Flippant.Adapter.Redis,\n         redis_opts: [url: System.get_env(\"REDIS_URL\"), name: :flippant],\n         set_key: \"flippant-features\"\n  ```\n\n## Usage\n\nComplete [documentation is available online](https://hexdocs.pm/flippant), but\nhere is a brief overview:\n\nFeatures are comprised of `groups`, and `rules`. Your application defines named\n`groups`, and you set `rules` to specify which `groups` are enabled for a\nparticular feature. When it comes time to check if a feature is enabled for a\nparticular `actor` (i.e. user or account), all the `groups` for a feature are\nevaluated. If the `actor` belongs to any of the `groups` then the feature is\nenabled.\n\nAll interaction happens directly through the `Flippant` module.\n\nDefine some basic groups:\n\n```elixir\nFlippant.register(\"staff\", fn %User{staff?: staff?}, _ -\u003e staff?)\nFlippant.register(\"testers\", fn %User{id: id}, ids -\u003e id in ids end)\n```\n\nSet a few rules for the \"search\" feature:\n\n```elixir\nFlippant.enable(\"search\", \"staff\")\nFlippant.enable(\"search\", \"testers\", [1818, 1819])\n```\n\nCheck if the current user has access to a feature:\n\n```elixir\nFlippant.enabled?(\"search\", %User{id: 1817, staff?: false}) #=\u003e true\nFlippant.enabled?(\"search\", %User{id: 1818, staff?: false}) #=\u003e false\nFlippant.enabled?(\"search\", %User{id: 1820, staff?: true}) #=\u003e true\n```\n\n## License\n\nMIT License, see [LICENSE.txt](LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorentwo%2Fflippant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorentwo%2Fflippant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorentwo%2Fflippant/lists"}