Make recipient changes explicit, prioritize verification retry, and label simulated outcomes prominently. Add shared typed analytics with bounded dummy capture, correlated service events and documented PostHog adapter contract. Validate privacy, retries, abandonment, keyboard recovery and accessibility. Related to #12.
22 lines
930 B
Markdown
22 lines
930 B
Markdown
# SXCHNGE analytics
|
|
|
|
Shared pure-Dart analytics contract, semantic journey recorder and bounded
|
|
in-memory dummy service. No PostHog SDK, network, persistence or logging.
|
|
|
|
```dart
|
|
final analytics = DummyAnalyticsService();
|
|
final recorder = JourneyRecorder(analytics);
|
|
final operation = recorder.begin(JourneyKind.login, JourneyStep.login);
|
|
recorder.finish(operation, simulated: true, terminal: true);
|
|
final captured = analytics.events; // immutable snapshot
|
|
recorder.dispose();
|
|
```
|
|
|
|
Inject an `AnalyticsService` implementation to replace the sink. Consumers do not
|
|
await analytics. See [the auth journey contract](../../../docs/ux/auth-journeys.md)
|
|
for schema, metric definitions, simulation rules, privacy, retry/abandonment
|
|
semantics, PostHog adapter guidance and measurement limitations.
|
|
|
|
Run `flutter test` and `flutter analyze` here. The production library imports
|
|
only Dart SDK libraries and can be reused by web and mobile.
|