Skip to main content

herald 1.0.0-dev.2 copy "herald: ^1.0.0-dev.2" to clipboard
herald: ^1.0.0-dev.2 copied to clipboard

One analytics vocabulary, heard by every vendor. Events, properties and the Herald fan-out, in pure Dart with no vendor SDK.

Herald #

Events, properties and the Herald fan-out: the core of Herald for Flutter, in pure Dart, with no Flutter, vendor SDK or DI library. Vendors are separate packages.

final class CheckoutStarted extends Event {
  const CheckoutStarted(this.plan, this.seats);

  final String plan;
  final int seats;

  @override
  String get name => 'checkout_started';

  @override
  Map<String, AnalyticsValue> get parameters => {'plan': .string(plan), 'seats': .int(seats)};
}

final herald = Herald(
  providers: [
    HeraldProvider(name: 'analytics', events: analyticsTracker, properties: analyticsTracker),
    HeraldProvider(name: 'attribution', events: attributionTracker),
  ],
  errorReporter: (failure) => report(failure.error, failure.stackTrace),
);

await herald.track(const CheckoutStarted('pro', 3));

Herald implements all five capabilities — EventTrackerService, PropertyTrackerService, IdentifiableUserService, AnalyticsLifecycleService and ConsentService — so give your classes the one interface they use.

Each call runs against every vendor at once, and a failing vendor is reported without stopping the others. Calls don't wait for each other, so when order matters, await the earlier call.

Documentation #

The Herald website has the guides, and the repository has the other packages and an example app.

0
likes
0
points
556
downloads

Publisher

unverified uploader

Weekly Downloads

One analytics vocabulary, heard by every vendor. Events, properties and the Herald fan-out, in pure Dart with no vendor SDK.

Repository (GitHub)
View/report issues

Topics

#analytics #tracking #events

License

unknown (license)

More

Packages that depend on herald