Skip to content

Unleash/unleash-openfeature-rust-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unleash OpenFeature Rust Provider

Rust OpenFeature provider backed by the Unleash Rust SDK.

Build

cargo build

Test

cargo test

Test Harness

This repository includes the OpenFeature provider verifier as a git submodule. After cloning, initialize it before running the full test suite:

git submodule update --init --recursive

If the verifier submodule is intentionally updated, refresh it and commit the new submodule pointer:

git submodule update --remote --merge verifier
git status

Example

cargo run --example boolean_flag -- \
  --url https://app.unleash-hosted.com/demo/api \
  --api-key "$UNLEASH_API_KEY" \
  --flag-key my-feature \
  --targeting-key user-123

The Unleash Rust client must be created with string feature lookup enabled:

use unleash_api_client::ClientBuilder;
use unleash_openfeature_rust_provider::{UnleashApiClient, UnleashFlagProvider};

let unleash_client = ClientBuilder::default()
    .enable_string_features()
    .into_client::<NoFeatures>(
        url,
        app_name,
        instance_id,
        Some(api_key),
    )?;

let provider = UnleashFlagProvider::new(UnleashApiClient::new(unleash_client));
provider.initialize_client().await?;

About

Official Open Feature Rust provider

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages