Skip to main content

split_openfeature_provider_dart_client 0.1.0 copy "split_openfeature_provider_dart_client: ^0.1.0" to clipboard
split_openfeature_provider_dart_client: ^0.1.0 copied to clipboard

Split OpenFeature provider for Dart (client-side / static-context) — adapts splitio_client_side to the OpenFeature FeatureProvider contract.

example/main.dart

import 'package:openfeature_dart_client_sdk/openfeature_dart_client_sdk.dart';
import 'package:split_openfeature_provider_dart_client/split_openfeature_provider_dart_client.dart';
import 'package:splitio_client_side/splitio_client_side.dart'
    show SplitFactory, SplitClientConfig;

Future<void> main() async {
  final splitFactory = SplitFactory.create(
    'CLIENT_SIDE_SDK_KEY',
    SplitClientConfig(),
    'TARGETING_KEY',
  );

  final provider = OpenFeatureSplitProvider(splitFactory);
  await OpenFeatureAPI.instance.setProviderAndWait(provider);

  await OpenFeatureAPI.instance.setEvaluationContextAndWait(
    EvaluationContext(targetingKey: 'TARGETING_KEY'),
  );

  final client = OpenFeatureAPI.instance.getClient();
  final showBanner = client.getBooleanValue('show_banner', false);
  print('show_banner: $showBanner');

  await provider.shutdown();
}
0
likes
135
points
228
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Split OpenFeature provider for Dart (client-side / static-context) — adapts splitio_client_side to the OpenFeature FeatureProvider contract.

Repository (GitHub)
View/report issues

Topics

#openfeature #feature-flags #split #feature-management

License

unknown (license)

Dependencies

openfeature_dart_client_sdk, splitio_client_side

More

Packages that depend on split_openfeature_provider_dart_client