liquid_analytics 0.2.0 copy "liquid_analytics: ^0.2.0" to clipboard
liquid_analytics: ^0.2.0 copied to clipboard

Vendor-neutral analytics for Flutter. Emit one typed event and fan it out to any set of providers through a middleware pipeline and a built-in consent gate.

Changelog #

0.2.0 #

Two breaking behaviour changes. Both make the library fail safe rather than fail open; neither changes a type signature.

  • BREAKING — ConsentPolicy.map is now an explicit allowlist. Previously a category with no entry in the map was delivered to every capable sink. Now a non-empty map means a category with no entry reaches no sink, so forgetting to map a category withholds data instead of broadcasting it. An entirely empty map still means "routing is not configured" and every capable sink stays eligible, so ConsentPolicy.allowAll and the default policy behave as before. Debug builds log a one-time warning per unmapped category.

    Migration: if you pass a non-empty map, add an entry for every category you emit.

  • BREAKING — PiiRedactor now recurses. Redacted keys were matched only at the top level of properties and traits, so {'user': {'email': ...}} reached every destination that forwards nested structures (PostHog, Mixpanel, Amplitude, Segment). Keys are now matched at any depth, including inside maps held in lists.

    Migration: none required, but expect more values to be redacted. Iterables are normalized to lists, which is what the provider mappers already did.

0.1.1 #

Two correctness fixes in the consent gate and the event pipeline. Both are behaviour changes; neither changes the public API.

  • Consent is now re-checked when the delivery queue drains. Previously consent was evaluated only when an event was emitted and when it was enqueued. An event that was queued (batch mode, or awaiting retry after a sink failure) while consent was granted would still be delivered even if the user revoked consent before the flush — and because the queue is persisted, that could happen on a later launch. Queued entries whose category has since been denied, or which no longer route to the sink under ConsentPolicy.map, are now dropped; entries whose category has returned to undecided are held rather than sent.
  • Event order is now preserved when middleware is asynchronous. LiquidMiddleware.apply returns a FutureOr, but the client did not wait for one message to finish the pipeline before starting the next, so any middleware that awaited (device info, disk, network) let later events overtake earlier ones and reach sinks out of order. The pipeline is now serialized, which also fixes ordering of the consent buffer replay. A slow sink now delays the events behind it — use DeliveryOptions.batchMode for HTTP-heavy destinations.
  • Liquid.flush() now waits for in-flight pipeline work before draining, so events emitted immediately before the call are included.
  • A middleware that throws no longer stops subsequent events from being processed.
  • Add an example/ covering typed events, consent gating and fan-out.

0.1.0 #

  • Initial release of liquid_analytics.
  • Typed events, middleware pipeline, consent gate with buffer/replay.
  • Offline delivery queue with exponential backoff and optional persistence.
  • Batch mode with count/timer flush policies; lifecycle flush.
1
likes
160
points
287
downloads

Documentation

API reference

Publisher

verified publisherketok.id

Weekly Downloads

Vendor-neutral analytics for Flutter. Emit one typed event and fan it out to any set of providers through a middleware pipeline and a built-in consent gate.

Repository (GitHub)
View/report issues
Contributing

Topics

#analytics #flutter #consent #gdpr

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on liquid_analytics