You should initialize the SDK in the top-level app state and store it in a variable
for use across your application. For example, you may want to initialize it in
your app delegate.
Example:
final analytics = createClient(Configuration("WRITE_KEY"));
Configuration options:
Option
Type
Description
writeKey
String
Your Hightouch write key.
apiHost
String
The API host to send the tracked events to.
trackApplicationLifecycleEvents
Bool
Whether to automatically track application lifecycle events (like opening the application). Defaults to false.
The Flutter SDK buffers events locally before sending them to Hightouch's servers.
This minimizes the number of requests made by the SDK and makes the tracking
non-blocking.
To force the local buffer to be sent to Hightouch immediately call the flush()
method.
The reset method resets the identify and group for the local session.
Specifically, it resets the anonymousId, userId, referrer, and traits.
The reset method should be called when users log out. This way, if the user
logs back in with another account, the userIds and traits from the different
sessions remain separate.
Ready to get started?
Jump right in or a book a demo. Your first destination is always free.