PostHogConfig class

Configuration used to initialize the PostHog Flutter SDK.

Create an instance with your project token, customize any options, and pass it to Posthog().setup(config).

Constructors

PostHogConfig(String projectToken, {OnFeatureFlagsCallback? onFeatureFlags, List<BeforeSendCallback>? beforeSend})
Creates a configuration for projectToken.

Properties

apiKey String
Deprecated alias for projectToken.
no setter
beforeSend List<BeforeSendCallback>
Callbacks to intercept and modify events before they are sent to PostHog.
getter/setter pair
captureApplicationLifecycleEvents bool
Whether the SDK captures application lifecycle events automatically.
getter/setter pair
dataMode PostHogDataMode
Network connection types that can be used to send data on Apple platforms.
getter/setter pair
debug bool
Whether the SDK emits verbose debug logs.
getter/setter pair
errorTrackingConfig PostHogErrorTrackingConfig
Configuration for error tracking and exception capture.
final
flushAt int
Number of queued events that triggers an automatic flush.
getter/setter pair
flushInterval Duration
Maximum time between automatic flush attempts.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
host String
The PostHog ingestion host.
getter/setter pair
logsConfig PostHogLogsConfig
Configuration for the logs subsystem (Posthog().captureLog() and the Posthog().logger facade).
final
maxBatchSize int
Maximum number of events sent in a single batch.
getter/setter pair
maxQueueSize int
Maximum number of events stored in the local queue.
getter/setter pair
onFeatureFlags ↔ OnFeatureFlagsCallback?
Callback to be invoked when feature flags are loaded.
getter/setter pair
optOut bool
Whether the SDK starts with data collection disabled.
getter/setter pair
personProfiles PostHogPersonProfiles
Controls whether captured events create or update person profiles.
getter/setter pair
preloadFeatureFlags bool
Whether feature flags are loaded when the SDK starts.
getter/setter pair
projectToken String
Your PostHog project token.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendFeatureFlagEvents bool
Whether calls that evaluate feature flags capture $feature_flag_called.
getter/setter pair
sessionReplay bool
Whether mobile session replay is enabled for Android and iOS.
getter/setter pair
sessionReplayConfig PostHogSessionReplayConfig
Configuration for mobile session replay.
getter/setter pair
surveys bool
Enable Surveys
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts this configuration to a platform-channel map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited