flipt_client 0.1.0-pre.1
flipt_client: ^0.1.0-pre.1 copied to clipboard
Flipt Client Evaluation SDK for Dart
Flipt Client Dart #
The flipt-client-dart
library contains the Dart source code for the Flipt client-side evaluation client.
Installation #
Add this to your package's pubspec.yaml
file:
dependencies:
flipt_client: ^0.1.0
copied to clipboard
Then run dart pub get
to install the package.
Supported Architectures #
This SDK currently supports the following OSes/architectures:
- Linux x86_64
- Linux arm64
- MacOS x86_64
- MacOS arm64
Important
This SDK currently only supports desktop platforms (MacOS and Linux). We are working on adding support for mobile platforms such as iOS and Android.
Usage #
import 'package:flipt_client/flipt_client.dart';
void main() {
// Initialize the client
final client = FliptEvaluationClient(
'default',
Options.withClientToken(
'your-token',
url: 'http://localhost:8080',
),
);
// Evaluate a variant flag
final result = client.evaluateVariant(
flagKey: 'flag1',
entityId: 'someentity',
context: {'fizz': 'buzz'},
);
print('Variant: ${result.variantKey}');
// Evaluate a boolean flag
final result = client.evaluateBoolean(
flagKey: 'flag2',
entityId: 'user123',
context: {'key': 'value'},
);
print('Enabled: ${result.enabled}');
// Don't forget to close the client when you're done
client.close();
}
copied to clipboard
Authentication #
The FliptEvaluationClient
supports the following authentication strategies:
- No Authentication (default)
- Client Token Authentication
- JWT Authentication
Development #
To generate the JSON serialization code, run:
dart run build_runner build --delete-conflicting-outputs
copied to clipboard
Contributing #
Contributions are welcome! Please feel free to open an issue or submit a Pull Request.
License #
This project is licensed under the MIT License.