AnalyticsConfig class
createAnalytics configuration.
Constructors
-
AnalyticsConfig({required String app, required String env, String? endpoint, String? writeKey, bool enabled = true, double sampleRate = 1, List<
String> redactKeys = const [], List<AnalyticsSink> sinks = const [], SessionConfig? session, IdentityConfig? identity, ConsentConfig? consent, String? preset, int batchSize = 20, int flushIntervalMs = 10000, HttpTransport? httpTransport, double random()?, int now()?}) -
const
Properties
- app → String
-
Product/app identifier (stamped into context.app).
final
- batchSize → int
-
Batch size before an automatic flush (prod). Default 20.
final
- consent → ConsentConfig?
-
Consent gate config.
final
- enabled → bool
-
Kill switch — when false, a tree-shakeable noop is returned. Default true.
final
- endpoint → String?
-
When set, a built-in HTTP sink is auto-registered to this endpoint.
final
- env → String
-
Environment, e.g. 'development' | 'production'. Drives presets.
final
- flushIntervalMs → int
-
Auto-flush interval in ms (prod). Default 10000.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpTransport → HttpTransport?
-
Transport for the auto-registered HTTP sink (test injection).
final
- identity → IdentityConfig?
-
Identity engine config.
final
- now → int Function()?
-
Injected clock (epoch ms) for deterministic session tests.
final
- preset → String?
-
Force a preset. Defaults: env=='production' → 'prod', else 'dev'.
final
- random → double Function()?
-
Injected RNG for deterministic sampling tests (0..1).
final
-
redactKeys
→ List<
String> -
Extra property/trait keys to redact (in addition to the PII deny-list).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sampleRate → double
-
0..1 sampling rate applied per top-level call. Default 1.
final
- session → SessionConfig?
-
Session engine config.
final
-
sinks
→ List<
AnalyticsSink> -
Explicit sinks (in addition to / instead of the auto HTTP sink).
final
- writeKey → String?
-
Write key for the auto-registered HTTP sink.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited