You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,10 +41,10 @@ import MCPInstall from '@site/src/partials/mcp-install';
41
41
The following [Kotlin Multiplatform Targets](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-dsl-reference.html#targets) are supported:
// Track a user action associated with a feature flag evaluation
226
+
await client.track(
227
+
'checkout-completed',
228
+
context: EvaluationContext(attributes: {
229
+
'user': 'user-123',
230
+
}),
231
+
trackingDetails: TrackingEventDetails(
232
+
value: 99.99,
233
+
attributes: {'currency': 'USD'},
234
+
),
235
+
);
236
+
```
237
+
217
238
### Logging
218
239
219
240
Note that in accordance with the OpenFeature specification, the SDK doesn't generally log messages during flag evaluation.
220
241
221
242
#### Logging Hook
222
243
223
-
The Dart SDK includes a `LoggingHook`, which logs detailed information at key points during flag evaluation, using [TBD](https://github.com/open-feature/dart-server-sdk/blob/main/TBD) structured logging API.
244
+
The Dart SDK includes a `LoggingHook`, which logs detailed information at key points during flag evaluation, using the [package:logging](https://pub.dev/packages/logging) structured logging API.
224
245
This hook can be particularly helpful for troubleshooting and debugging; simply attach it at the global, client or invocation level and ensure your log level is set to "debug".
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency.
389
410
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/dart-server-sdk-contrib) available under the OpenFeature organization.
390
-
You’ll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
411
+
You'll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
391
412
392
413
```dart
393
414
import 'dart:async';
@@ -418,6 +439,15 @@ class MyCustomProvider implements FeatureProvider {
418
439
// Clean up resources
419
440
}
420
441
442
+
@override
443
+
Future<void> track(
444
+
String trackingEventName, {
445
+
Map<String, dynamic>? evaluationContext,
446
+
TrackingEventDetails? trackingDetails,
447
+
}) async {
448
+
// Send tracking event to your backend, or no-op if unsupported
0 commit comments