{"id":13606455,"url":"https://github.com/MiSikora/laboratory","last_synced_at":"2025-04-12T08:31:17.630Z","repository":{"id":37084229,"uuid":"271023663","full_name":"MiSikora/laboratory","owner":"MiSikora","description":"Feature flags for multi-module Kotlin Android projects","archived":false,"fork":false,"pushed_at":"2025-04-01T08:40:16.000Z","size":3417,"stargazers_count":82,"open_issues_count":12,"forks_count":2,"subscribers_count":3,"default_branch":"trunk","last_synced_at":"2025-04-06T07:11:47.702Z","etag":null,"topics":["ab-testing","abc-testing","android","android-development","code-generation","feature-flags","gradle-plugin","jetpack-android","jetpack-datastore","kotlin","kotlin-android","laboratory"],"latest_commit_sha":null,"homepage":"https://mehow.io/laboratory/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiSikora.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-09T14:21:51.000Z","updated_at":"2024-12-02T07:28:07.000Z","dependencies_parsed_at":"2024-06-03T08:54:00.046Z","dependency_job_id":"4a94343d-d0c0-4f9b-b4d7-03d694f27967","html_url":"https://github.com/MiSikora/laboratory","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiSikora%2Flaboratory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiSikora%2Flaboratory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiSikora%2Flaboratory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiSikora%2Flaboratory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiSikora","download_url":"https://codeload.github.com/MiSikora/laboratory/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248539821,"owners_count":21121239,"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":["ab-testing","abc-testing","android","android-development","code-generation","feature-flags","gradle-plugin","jetpack-android","jetpack-datastore","kotlin","kotlin-android","laboratory"],"created_at":"2024-08-01T19:01:09.297Z","updated_at":"2025-04-12T08:31:12.616Z","avatar_url":"https://github.com/MiSikora.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Laboratory ⚗️\n\n[\u003cimg src=\"https://img.shields.io/maven-central/v/io.mehow.laboratory/laboratory.svg?label=latest%20release\"/\u003e](https://search.maven.org/search?q=g:io.mehow.laboratory)\n[\u003cimg src=\"https://img.shields.io/nexus/s/https/oss.sonatype.org/io.mehow.laboratory/laboratory.svg?label=latest%20snapshot\"/\u003e](https://oss.sonatype.org/content/repositories/snapshots/io/mehow/laboratory/)\n\nFeature flags for multi-module Kotlin Android projects.\n\nPlease visit [project website](https://mehow.io/laboratory/) for the full documentation and the [changelog](https://mehow.io/laboratory/changelog/).\n\n## TLDR\n\nAdd Laboratory dependency to your project.\n\n```groovy\nrepositories {\n  mavenCentral()\n}\n\ndependencies {\n  implementation \"io.mehow.laboratory:laboratory:1.1.0\"\n}\n```\n\nEnable [default methods generation](https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-m3-generating-default-methods-in-interfaces/).\n\n```groovy\nandroid {\n  kotlinOptions {\n    freeCompilerArgs += [\n        \"-Xjvm-default=all\",\n    ]\n  }\n}\n```\n\nDefine your feature flags.\n\n```kotlin\nenum class AuthType : Feature\u003cAuthType\u003e {\n  None,\n  Fingerprint,\n  Retina,\n  Face;\n\n  public override val defaultOption get() = Fingerprint\n}\n```\n\nStart using them in the application.\n\n```kotlin\nsuspend fun main() {\n  // A high-level API for interaction with feature flags\n  val laboratory = Laboratory.inMemory()\n\n  // Set AuthType option to Fingerprint\n  val success = laboratory.setOption(AuthType.Fingerprint)\n\n  // Check what is the current option of AuthType\n  val currentAuthType = laboratory.experiment\u003cAuthType\u003e()\n\n  // Check if the current option of AuthType is equal to Face\n  val isFaceAuth = laboratory.experimentIs(AuthType.Face)\n\n  // Observe changes to the AuthType feature flag\n  laboratory.observe\u003cAuthType\u003e()\n      .onEach { option -\u003e println(\"AuthType: $option\") }\n      .launchIn(GlobalScope)\n}\n```\n\n## License\n\n    Copyright 2020 Michał Sikora\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMiSikora%2Flaboratory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMiSikora%2Flaboratory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMiSikora%2Flaboratory/lists"}