https://github.com/configcat/openfeature-swift
ConfigCat OpenFeature Provider for Swift.
https://github.com/configcat/openfeature-swift
configcat feature-flagging feature-flags feature-toggles open-feature openfeature swift
Last synced: 12 months ago
JSON representation
ConfigCat OpenFeature Provider for Swift.
- Host: GitHub
- URL: https://github.com/configcat/openfeature-swift
- Owner: configcat
- License: mit
- Created: 2025-06-10T18:42:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-15T14:28:18.000Z (about 1 year ago)
- Last Synced: 2025-06-15T15:39:27.092Z (about 1 year ago)
- Topics: configcat, feature-flagging, feature-flags, feature-toggles, open-feature, openfeature, swift
- Language: Swift
- Homepage: https://configcat.com/docs/sdk-reference/openfeature/swift
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ConfigCat OpenFeature Provider for Swift
[](https://github.com/configcat/openfeature-swift/actions/workflows/ci.yml)
This repository contains an OpenFeature provider that allows [ConfigCat](https://configcat.com) to be used with
the [OpenFeature Swift SDK](https://github.com/open-feature/swift-sdk).
## Installation
### Swift Package Manager
If you manage dependencies through SPM, in the dependencies section of Package.swift add:
```swift
.package(url: "https://github.com/configcat/openfeature-swift", from: "0.1.0")
```
and in the target dependencies section add:
```swift
.product(name: "ConfigCat", package: "openfeature-swift"),
```
### Xcode Dependencies
- Open the dependencies dialog from `File` > `Add Package Dependencies...`
- Search for `https://github.com/configcat/openfeature-swift` and click `Add Package`.
## Usage
The initializer of `ConfigCatProvider` takes the SDK key and an optional `ConfigCatOptions`
argument containing the additional configuration options for
the [ConfigCat Swift SDK](https://github.com/configcat/swift-sdk):
```swift
import ConfigCatOpenFeature
import ConfigCat
import OpenFeature
Task {
// Configure the provider.
let provider = ConfigCatProvider(sdkKey: "") { opts in
opts.pollingMode = PollingModes.autoPoll()
}
// Configure the OpenFeature API with the ConfigCat provider.
await OpenFeatureAPI.shared.setProviderAndWait(provider: provider)
// Create a client.
let client = OpenFeatureAPI.shared.getClient()
// Evaluate feature flag.
let isAwesomeFeatureEnabled = client.getBooleanValue(key: "isAwesomeFeatureEnabled", defaultValue: false)
}
```
For more information about all the configuration options, see
the [Swift SDK documentation](https://configcat.com/docs/sdk-reference/ios/#creating-the-configcat-client).
## Need help?
https://configcat.com/support
## Contributing
Contributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).
## About ConfigCat
ConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You
can turn your features ON/OFF using ConfigCat Dashboard even
after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom
user attribute.
ConfigCat is a hosted feature flag service. Manage feature toggles
across frontend, backend, mobile, desktop apps. Alternative to
LaunchDarkly. Management app + feature flag SDKs.
- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)
- [Documentation](https://configcat.com/docs)
- [Blog](https://configcat.com/blog)