{"id":13338734,"url":"https://github.com/configcat/swift-sdk","last_synced_at":"2025-08-21T02:31:13.093Z","repository":{"id":32253754,"uuid":"129956350","full_name":"configcat/swift-sdk","owner":"configcat","description":"ConfigCat SDK for Swift. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.","archived":false,"fork":false,"pushed_at":"2025-06-14T12:25:23.000Z","size":770,"stargazers_count":27,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-16T11:26:29.246Z","etag":null,"topics":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","ios","macos","remote-config","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://configcat.com/docs/sdk-reference/ios","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/configcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-04-17T19:43:39.000Z","updated_at":"2025-06-14T12:25:26.000Z","dependencies_parsed_at":"2024-04-09T20:38:56.287Z","dependency_job_id":"62887ca0-addc-4fd7-a5da-82ea13cb72fc","html_url":"https://github.com/configcat/swift-sdk","commit_stats":{"total_commits":253,"total_committers":14,"mean_commits":"18.071428571428573","dds":0.5731225296442688,"last_synced_commit":"1d080a1b2d8c35099d27dcc4195e02aa20d75e41"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/configcat/swift-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fswift-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fswift-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fswift-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fswift-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/configcat","download_url":"https://codeload.github.com/configcat/swift-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fswift-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271416773,"owners_count":24755951,"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-08-21T02:00:08.990Z","response_time":74,"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":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","ios","macos","remote-config","swift","tvos","watchos"],"created_at":"2024-07-29T19:17:08.913Z","updated_at":"2025-08-21T02:31:13.084Z","avatar_url":"https://github.com/configcat.png","language":"Swift","readme":"# ConfigCat SDK for Swift\n\n[![Build Status](https://github.com/configcat/swift-sdk/actions/workflows/swift-ci.yml/badge.svg?branch=master)](https://github.com/configcat/swift-sdk/actions/workflows/swift-ci.yml)\n[![CocoaPods](https://img.shields.io/cocoapods/v/ConfigCat.svg)](https://cocoapods.org/pods/ConfigCat)\n[![Supported Platforms](https://img.shields.io/cocoapods/p/ConfigCat.svg?style=flat)](https://configcat.com/docs/sdk-reference/ios)\n[![Coverage Status](https://img.shields.io/sonar/coverage/configcat_swift-sdk?logo=SonarCloud\u0026server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/project/overview?id=configcat_swift-sdk)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=configcat_swift-sdk\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=configcat_swift-sdk)\n\nConfigCat SDK for Swift provides easy integration for your application to [ConfigCat](https://configcat.com).\n\nThe following device platform versions are supported:\n\n| Platform | Version    |\n| -------- | ---------- |\n| iOS      | \u003e= 12.0    |\n| watchOS  | \u003e= 4.0     |\n| tvOS     | \u003e= 12.0    |\n| macOS    | \u003e= 10.13   |\n| visionOS | \u003e= 1.0     |\n\n## Getting started\n\n### 1. Install the package\n\n- ### CocoaPods\n\n  Add the following to your `Podfile`:\n  ```ruby\n  target '\u003cYOUR TARGET\u003e' do\n  pod 'ConfigCat'\n  end\n  ```\n  Then, run the following command to install your dependencies:\n  ```bash\n  pod install\n  ```\n\n- ### Swift Package Manager\n\n  You can add ConfigCat to an Xcode project by adding it as a package dependency.\n\n  \u003e https://github.com/configcat/swift-sdk\n\n  If you want to use ConfigCat in a [SwiftPM](https://swift.org/package-manager/) project, it's as simple as adding a `dependencies` clause to your `Package.swift`:\n\n  ``` swift\n  dependencies: [\n    .package(url: \"https://github.com/configcat/swift-sdk\", from: \"11.3.0\")\n  ]\n  ```\n\n- ### Carthage\n\n  Add the following to your `Cartfile`:\n  ```\n  github \"configcat/swift-sdk\"\n  ```\n  Then, run the `carthage update` command and then follow the [Carthage integration steps](https://github.com/Carthage/Carthage#getting-started) to link the framework with your project.\n\n### 2. Go to the \u003ca href=\"https://app.configcat.com/sdkkey\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e to get your *SDK Key*:\n![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/swift-sdk/master/media/readme02-3.png  \"SDK-KEY\")\n\n### 3. Import the *ConfigCat* module to your application\n```swift\nimport ConfigCat\n```\n\n### 4. Create a *ConfigCat* client instance\n```swift\nlet client = ConfigCatClient.get(sdkKey: \"#YOUR-SDK-KEY#\")\n```\n\n### 5. Get your setting value\n```swift\nclient.getValue(for: \"isMyAwesomeFeatureEnabled\", defaultValue: false) { isMyAwesomeFeatureEnabled in\n    if isMyAwesomeFeatureEnabled {\n        doTheNewThing()\n    } else {\n        doTheOldThing()\n    }\n}\n\n// or with async/await\nlet isMyAwesomeFeatureEnabled = await client.getValue(for: \"isMyAwesomeFeatureEnabled\", defaultValue: false)\nif isMyAwesomeFeatureEnabled {\n    doTheNewThing()\n} else {\n    doTheOldThing()\n}\n```\n\n### 6. Close the client on application exit\n ```swift\n client.close();\n ```\n\n## Getting user specific setting values with Targeting\nUsing this feature, you will be able to get different setting values for different users in your application by passing a `User Object` to the `getValue()` function.\n\nRead more about [Targeting here](https://configcat.com/docs/advanced/targeting/).\n\n```swift\nlet user = ConfigCatUser(identifier: \"#USER-IDENTIFIER#\")\nclient.getValue(for: \"isMyAwesomeFeatureEnabled\", defaultValue: false, user: user) { isMyAwesomeFeatureEnabled in\n    if isMyAwesomeFeatureEnabled {\n        doTheNewThing()\n    } else {\n        doTheOldThing()\n    }\n}\n```\n\n## Sample/Demo app\n  [Sample iOS app](https://github.com/configcat/swift-sdk/tree/master/samples/ios)\n\n## Polling Modes\nThe ConfigCat SDK supports 3 different polling mechanisms to acquire the setting values from ConfigCat. After latest setting values are downloaded, they are stored in the internal cache then all requests are served from there. Read more about Polling Modes and how to use them at [ConfigCat Docs](https://configcat.com/docs/sdk-reference/ios/).\n\n## Sensitive information handling\n\nThe frontend/mobile SDKs are running in your users' browsers/devices. The SDK is downloading a [config.json](https://configcat.com/docs/requests) file from ConfigCat's CDN servers. The URL path for this config.json file contains your SDK key, so the SDK key and the content of your config.json file (feature flag keys, feature flag values, targeting rules, % rules) can be visible to your users. \nThis SDK key is read-only, it only allows downloading your config.json file, but nobody can make any changes with it in your ConfigCat account.\n\nIf you do not want to expose the SDK key or the content of the config.json file, we recommend using the SDK in your backend components only. You can always create a backend endpoint using the ConfigCat SDK that can evaluate feature flags for a specific user, and call that backend endpoint from your frontend/mobile applications.\n\nAlso, we recommend using [confidential targeting comparators](https://configcat.com/docs//advanced/targeting/#confidential-text-comparators) in the targeting rules of those feature flags that are used in the frontend/mobile SDKs.\n\n## Need help?\nhttps://configcat.com/support\n\n## Contributing\nContributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).\n\n## About ConfigCat\nConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using \u003ca href=\"https://app.configcat.com\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.\n\nConfigCat is a \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003ehosted feature flag service\u003c/a\u003e. Manage feature toggles across frontend, backend, mobile, desktop apps. \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003eAlternative to LaunchDarkly\u003c/a\u003e. Management app + feature flag SDKs.\n\n- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)\n- [Documentation](https://configcat.com/docs)\n- [Blog](https://configcat.com/blog)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fswift-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfigcat%2Fswift-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fswift-sdk/lists"}