https://github.com/configcat/openfeature-rust
ConfigCat OpenFeature Provider for Rust.
https://github.com/configcat/openfeature-rust
configcat feature-flagging feature-flags feature-toggles openfeature remote-configuration rust
Last synced: 5 months ago
JSON representation
ConfigCat OpenFeature Provider for Rust.
- Host: GitHub
- URL: https://github.com/configcat/openfeature-rust
- Owner: configcat
- License: mit
- Created: 2024-07-31T12:55:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-19T12:48:51.000Z (10 months ago)
- Last Synced: 2025-08-19T14:40:18.550Z (10 months ago)
- Topics: configcat, feature-flagging, feature-flags, feature-toggles, openfeature, remote-configuration, rust
- Language: Rust
- Homepage: https://configcat.com/docs/sdk-reference/openfeature/rust
- Size: 24.4 KB
- Stars: 1
- Watchers: 5
- 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 Rust
[](https://github.com/configcat/openfeature-rust/actions/workflows/ci.yml)
[](https://crates.io/crates/configcat-openfeature-provider)
[](https://docs.rs/configcat-openfeature-provider)
This repository contains an OpenFeature provider that allows [ConfigCat](https://configcat.com) to be used with the [OpenFeature Rust SDK](https://github.com/open-feature/rust-sdk).
## Installation
Run the following Cargo command in your project directory:
```shell
cargo add configcat-openfeature-provider
```
Or add the following to your `Cargo.toml`:
```toml
[dependencies]
configcat-openfeature-provider = "0.1"
```
## Usage
The `ConfigCatProvider` needs a pre-configured [ConfigCat Rust SDK](https://github.com/configcat/rust-sdk) client:
```rust
use std::time::Duration;
use configcat::{Client, PollingMode};
use open_feature::OpenFeature;
use configcat_openfeature_provider::ConfigCatProvider;
#[tokio::main]
async fn main() {
// Acquire an OpenFeature API instance.
let mut api = OpenFeature::singleton_mut().await;
// Configure the ConfigCat SDK.
let configcat_client = Client::builder("")
.polling_mode(PollingMode::AutoPoll(Duration::from_secs(60)))
.build()
.unwrap();
// Configure the provider.
api.set_provider(ConfigCatProvider::new(configcat_client)).await;
// Create a client.
let client = api.create_client();
// Evaluate a feature flag.
let is_awesome_feature_enabled = client
.get_bool_value("isAwesomeFeatureEnabled", None, None)
.await
.unwrap_or(false);
}
```
For more information about all the configuration options, see the [Rust SDK documentation](https://configcat.com/docs/sdk-reference/rust/#creating-the-configcat-client).
## Example
This repository contains a simple [example application](./examples/print_eval.rs) that you can run with:
```shell
cargo run --example print_eval
```
## 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)