{"id":19045057,"url":"https://github.com/immobiliare/realflags","last_synced_at":"2025-04-09T20:05:46.175Z","repository":{"id":40464218,"uuid":"409666363","full_name":"immobiliare/RealFlags","owner":"immobiliare","description":"🔧 Feature Flagging for Swift","archived":false,"fork":false,"pushed_at":"2024-04-02T10:58:12.000Z","size":11025,"stargazers_count":192,"open_issues_count":8,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T20:05:40.019Z","etag":null,"topics":["combine","combine-framework","feature-flags","feature-toggles","featureflags","firebaseremoteconfig","flipping","remote-config","swift","toggle"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/immobiliare.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-09-23T16:29:38.000Z","updated_at":"2025-03-12T07:24:35.000Z","dependencies_parsed_at":"2024-01-13T22:54:33.051Z","dependency_job_id":"c5677ef7-cf78-4a35-802e-30a83ab6df1d","html_url":"https://github.com/immobiliare/RealFlags","commit_stats":{"total_commits":174,"total_committers":4,"mean_commits":43.5,"dds":"0.017241379310344862","last_synced_commit":"5c574e4c97908e1b2ece415d119a6cb9b5e18a06"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immobiliare%2FRealFlags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immobiliare%2FRealFlags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immobiliare%2FRealFlags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immobiliare%2FRealFlags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/immobiliare","download_url":"https://codeload.github.com/immobiliare/RealFlags/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["combine","combine-framework","feature-flags","feature-toggles","featureflags","firebaseremoteconfig","flipping","remote-config","swift","toggle"],"created_at":"2024-11-08T22:48:38.508Z","updated_at":"2025-04-09T20:05:46.144Z","avatar_url":"https://github.com/immobiliare.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cpicture\u003e\n \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./documentation/assets/realflags-dark.png\" width=\"350\"\u003e\n \u003cimg alt=\"logo-library\" src=\"./documentation/assets/realflags-light.png\" width=\"350\"\u003e\n\u003c/picture\u003e\n\u003c/p\u003e\n\nRealFlags makes it **easy to configure feature flags**in your codebase. \nIt's designed for Swift and **provides a simple and elegant abstraction layer** over multiple providers you can query with your priority. \nIt also has a **handy UI tool to browse and alter values directly at runtime!**\n\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n\u003cb\u003e\u003ca href=\"#features-highlights\"\u003eFeatures\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#what-you-get\"\u003eWhat You Get\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#flags-browser--editor\"\u003eFlags Browser \u0026 Editor\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#tests\"\u003eTests\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#requirements\"\u003eRequirements\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#powered-apps\"\u003ePowered Apps\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#support\"\u003eSupport \u0026 Contribute\u003c/a\u003e\u003c/b\u003e\n|\n\u003cb\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n## Features Highlights\n\n- 💡 **Simple \u0026 Elegant**: Effectively describe and organize your own flags with a type-safe structure. It will abstract your implementation and consistently reduce the amount of code to manage your feature flags\n- 💡 **Extensible**: You can use one of the default data providers or create your own. We support Firebase Remote and Local configurations too\n- 💡 **Complete**: Feature Flags support all primitive datatypes and complex objects: `Int` (and any numeric variant), `String`, `Bool`, `Data`, `Date`, `URL`, `Dictionary`, `Array` (values must conform to `FlagProtocol`), Optional Values and virtually any object conform to `Codable` protocol!\n- 💡 **Configurable**: Enable, disable and customize features at runtime\n- 💡 **Integrated UI Tool**: the handy UI Tool allows you to customize and read flags at a glance\n\n## An Hands-on Approach\n\nWould you use RealFlags in your product? We wrote an article about it. \n**Check it out [here](https://www.offnotes.org/feature-flags/)**\n\n## What You Get\n\nOur goal in making RealFlags is to provide a type-safe abstract way to describe and query for feature flags.\n\nThe first step is to describe your collection of flags:\n\n```swift\n// Define the structure of your feature flags with type-safe properties!\nstruct UserFlags: FlagCollectionProtocol {\n @Flag(default: true, description: \"Show social login options along native login form\")\n var showSocialLogin: Bool\n \n @Flag(default: 0, description: \"Maximum login attempts before blocking account\")\n var maxLoginAttempts: Int\n \n @Flag(key: \"rating_mode\", default: \"at_launch\", description: \"The behaviour to show the rating popup\")\n var appReviewRating: String\n\n public init() {}\n}\n```\n\nThis represents a type-safe description of some flags grouped in a collection. \nEach feature flags property is identified by the `@Flag` annotation. \nIt's time load values for this collection; using a new `FlagsLoader` you will be able to load and query collection's values from one or more data providers:\n\n```swift\n// Allocate your own data providers\nlet localProvider = LocalProvider(localURL: fileURL)\nlet fbProvider = FirebaseRemoteProvider()\n\n// Loader is the point for query values\nlet userFlagsLoader = FlagsLoader(UserFlags.self, // load flags definition\n description: .init(name: \"User Features\", description: \"Cool experimental features for user account\"),\n providers: [fbProvider, localProvider]) // set providers\n```\n\nNow you can query values from `userFlagsLoader` by using the `UserFlags` structure (it supports autocomplete and type-safe values thanks to `@dynamicMemberLookup`!). \nLet me show it:\n\n```swift\nif userFlagsLoader.showSocialLogin { // query properties as type-safe with autocomplete!\n // do some stuff\n}\n```\n\nValues are obtained respecting the order you have specified, in this case from Firebase Remote Config service, then, when no value is found, into the local repository. \nIf no values are available, the default value specified in `@Flags` annotation is returned.\n\nThis is just an overview of the library; if you want to know more, follow the [documentation below](#documentation).\n\n## Flags Browser \u0026 Editor\n\nRealFlags also comes with a handy tool you can use to browse and edit feature flag values directly in your client! It can be helpful for testing purposes or allow product owners to enable/disable and verify features of the app.\n\n[Checkout the doc for more infos!](./documentation/advanced_usage.md#3.5)\n\n\nhttps://user-images.githubusercontent.com/235645/150638946-99646e96-d155-451f-a723-585ad7978c43.mp4\n\n## API Reference\n\nRealFlags is fully documented at the source-code level. You'll get autocomplete with doc inside XCode for free; moreover, you can read the full Apple's DoCC Documentation automatically generated thanks to [**Swift Package Index**](https://swiftpackageindex.com) Project from here:\n\n👉 [API REFERENCE](https://swiftpackageindex.com/immobiliare/RealFlags)\n\n## Documentation\n\nThe following documentation describes detailed usage of the library.\n\n- 1.0 - [Introduction](./documentation/introduction.md) \n   - 1.1 - [@Flag Annotation](./documentation/introduction.md#11-flag-annotation)\n   - 1.2 - [@Flag Supported Datatypes](./documentation/introduction.md#12--flag-supported-data-types)\n   - 1.3 - [`Codable` types and `@Flag`](#13-codable-types-and--flag)\n   - 1.4 - [Computed @Flag](./documentation/introduction.md#14-computed--flag)\n   - 1.5 - [Load a Feature Flag Collection in a `FlagLoader`](./documentation/introduction.md#15-load-a-feature-flag-collection-in-a-flagloader)\n   - 1.6 - [Configure Key Evaluation for `FlagsLoader`'s `@Flag`](./documentation/introduction.md#16-configure-key-evaluation-for-flagsloaders-flag)\n   - 1.7 - [Query a specific data provider](./documentation/introduction.md#17-query-a-specific-data-provider) \n   - 1.8 - [Set Flag defaultValue at runtime](./documentation/introduction.md#18-set-flag-defaultvalue-at-runtime)\n   - 1.9 - [Reset Flag values](./documentation/introduction.md#19-reset-flag-values)\n   - 1.10 - [Reset LocalProvider values](./documentation/introduction.md#110-reset-localprovider-values)\n- 2.0 - [Organize Feature Flags](./documentation/organize_feature_flags.md) \n   - 2.1 - [The `@FlagCollection` annotation](./documentation/organize_feature_flags.md#21-the-flagcollection-annotation)\n   - 2.2 - [Nested Structures](./documentation/organize_feature_flags.md#22-nested-structures)\n   - 2.3 - [Configure `FlagCollection`'s contribution to properties keypath generation](./documentation/organize_feature_flags.md#23-configure-flagcollections-contribution-to-properties-keypath-generation)\n- 3.0 - [Advanced Usage](./documentation/advanced_usage.md) \n   - 3.1 - [Using FlagsManager](./documentation/advanced_usage.md#31-using-flagsmanager)\n   - 3.2 - [Use and Creation of Data Providers](./documentation/advanced_usage.md#32---use-and-creation-of-data-providers)\n   - 3.3 - [Firebase Remote Config with FirebaseRemoteProvider](./documentation/advanced_usage.md#33-firebase-remote-config-with-firebaseremoteprovider)\n   - 3.4 - [Modify a feature flag at runtime](./documentation/advanced_usage.md#34-modify-a-feature-flag-at-runtime)\n   - 3.5 - [Flags Browser \u0026 Editor](./documentation/advanced_usage.md#35-flags-browser--editor)\n\n## Test Suite\n\nRealFlags includes an extensive collection of unit tests: you can find it in the `Tests` directory.\n## Requirements\n\nRealFlags can be installed on any platform which supports Swift 5.4+, including Windows and Linux. On Apple platform, the following configuration is required:\n\n- iOS 12+\n- Xcode 12.5+\n- Swift 5.4+\n\n## Installation\n\nTo use RealFlags in your project you can use Swift Package Manager (our primary choice) or CocoaPods.\n\n### Swift Package Manager\n\nAdd it as a dependency in a Swift Package, and add it to your `Package.swift`:\n\n```swift\ndependencies: [\n .package(url: \"https://github.com/immobiliare/RealFlags.git\", from: \"1.0.0\")\n]\n```\n\nAnd add it as a dependency of your target:\n\n```swift\ntargets: [\n .target(name: \"MyTarget\", dependencies: [\n .product(name: \"https://github.com/immobiliare/RealFlags.git\", package: \"RealFlags\")\n ])\n]\n```\n\nIn Xcode 11+, you can also navigate to the File menu and choose Swift Packages -\u003e Add Package Dependency..., then enter the repository URL and version details.\n\n### CocoaPods\n\nRealFlags can be installed with CocoaPods by adding pod 'RealFlags' to your Podfile.\n\n```ruby\npod 'RealFlags' // to import the core framework\npod 'RealFlagsFirebase' // to also import Firebase Data Provider\n```\n\n## Powered Apps\n\nThe amazing mobile team at ImmobiliareLabs created RealFlags, the Tech dept at Immobiliare.it, the first real estate site in Italy. \nWe are currently using RealFlags in all of our products.\n\n**If you are using RealFlags in your app [drop us a message](mailto://mobile@immobiliare.it)**.\n## Support\n\n\u003ca href=\"http://labs.immobiliare.it\"\u003e\u003cimg src=\"./documentation/assets/immobiliarelabs.png\" alt=\"ImmobiliareLabs\" width=\"200\"/\u003e\u003c/a\u003e\n\nWe'd love for you to contribute to RealFlags! \nIf you have questions about using RealFlags, bugs, and enhancement, please feel free to reach out by opening a [GitHub Issue](https://github.com/immobiliare/RealFlags/issues).\n\n## License\n\nRealFlags is licensed under the MIT license. \nSee the [LICENSE](./LICENSE) file for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmobiliare%2Frealflags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimmobiliare%2Frealflags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmobiliare%2Frealflags/lists"}