{"id":21820346,"url":"https://github.com/trademe/konfigure","last_synced_at":"2025-04-14T02:45:12.424Z","repository":{"id":36092158,"uuid":"199730977","full_name":"TradeMe/konfigure","owner":"TradeMe","description":"An Application Configuration Library based on Kotlin Property Delegation","archived":false,"fork":false,"pushed_at":"2025-03-18T19:32:41.000Z","size":372,"stargazers_count":34,"open_issues_count":2,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T16:50:34.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TradeMe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-30T21:36:34.000Z","updated_at":"2025-03-18T19:32:45.000Z","dependencies_parsed_at":"2024-11-27T16:46:49.335Z","dependency_job_id":null,"html_url":"https://github.com/TradeMe/konfigure","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2Fkonfigure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2Fkonfigure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2Fkonfigure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2Fkonfigure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TradeMe","download_url":"https://codeload.github.com/TradeMe/konfigure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812900,"owners_count":21165502,"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":[],"created_at":"2024-11-27T16:31:58.866Z","updated_at":"2025-04-14T02:45:12.398Z","avatar_url":"https://github.com/TradeMe.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Konfigure\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [ ![Download](https://api.bintray.com/packages/trademe/Konfigure/konfigure/images/download.svg) ](https://bintray.com/trademe/Konfigure/konfigure/_latestVersion)\n\nKotlin Property Delegation-based application configuration library. Tailored for Android, but ready for multiplatform.\n## Download\n\n```groovy\n// Base module\nimplementation \"nz.co.trademe.konfigure:konfigure:${current.version}\" \n\n// Android module, including UI\nimplementation \"nz.co.trademe.konfigure:konfigure-android:${current.version}\" \n\n// Extra: Firebase Remote Config\nimplementation \"nz.co.trademe.konfigure:konfigure-firebase:${current.version}\"\n```\n## Usage\n1. Create a config source, or optionally use `FirebaseRemoteConfigSource` from the `konfigure-firebase` module\n```kotlin\nobject LocalSource: ConfigSource {\n\n    override val all: Map\u003cString, String\u003e\n        get() = TODO(\"Provide some config key-value pairs\")\n}\n```\n   \n2. Create a config subclass \n```kotlin\nclass AppConfig: Config(configSources = listOf(LocalSource))\n```\n\n3. Add some configuration items\n```kotlin\nclass AppConfig: Config(configSources = listOf(LocalSource)) {\n\n    // The most simple config item, which uses the property name as a \n    // key and sensible non-null default values\n    val someSimpleItem: Boolean by config()\n\n    // Add a simple config item \n    val someItem: Boolean by config(\n        key = \"item_key\",\n        defaultValue = false\n    )\n\n    // OR, using `konfigure-android`, add a displayable config item\n    val someEditableItem: Boolean by config(\n        key = \"item_key_2\",\n        defaultValue = false,\n        title = \"Something\",\n        description = \"Some editable config item\",\n        group = \"Some group\"\n    )\n}\n```\n\n4. Use it!\n\n```kotlin\nval config = AppConfig()\n\n// Use the property! This will check your config sources, look for overrides, and if it doesn't \n// find anything will use the defaultValue parameter\nif (config.someItem) {\n    TODO(\"Do something cool\")\n}\n```\n\nKonfigure supports much more advanced usages however. By adding custom metadata, you can customise the behaviour of konfigure\nto your hearts content. For more examples, check out the [sample](/sample).\n\n## Modules\nKonfigure contains a number of modules, which are useful for different things. Here's a quick run down of what they all do - more information can be found within these modules.\n\n### [`konfigure`](/konfigure)\nThis is the base module for Konfigure, which contains the core logic. Usage is as describe in the usage section of this README.\n\n### [`konfigure-android`](/konfigure-android)\nThis module contains Android-specific utilities, as well as a UI component which allows you to change the value of the config items within the app. In here you'll find things like `SharedPreferencesOverrideHandler` which gives you easily persistable overrides, as well as `ConfigActivity` and `ConfigView` for presenting overrides.\n\n### [`konfigure-firebase`](/konfigure-firebase)\nThis module contains a pre-build Firebase Remote Config source. Eventually this could be made multiplatform, as the Firebase SDK can be found on most platforms Kotlin/Multiplatform supports.\n\n\n## Contributing \nWe love contributions, but make sure to checkout [CONTRIBUTING.MD](/CONTRIBUTING.MD) first!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fkonfigure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrademe%2Fkonfigure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fkonfigure/lists"}