Flutter SDK Reference
Full method and property reference for the emp_analytics Dart package.
EmpAnalytics.init()
Initializes the SDK singleton. Must be awaited before runApp().
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | String | Yes | Your public API key. |
| apiHost | String | No | Optional custom backend URL. |
| debug | bool | No | Enable debug logging. Default: false. |
| batchInterval | int | No | Flush interval in seconds. Default: 30. |
| maxBatchSize | int | No | Max events per batch. Default: 20. |
EmpAnalytics.track()
Queues an event to local storage for batch delivery.
| Parameter | Type | Required | Description |
|---|---|---|---|
| eventName | String | Yes | The event name. |
| properties | Map | No | Optional metadata. |
EmpAnalytics.identify()
Identifies a user with a unique ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The permanent user ID. |
EmpAnalytics.alias()
Creates an alias for a user, linking their past identity to their new identity.
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The permanent user ID. |
EmpAnalytics.people
Accessor for the People API to update user profiles.
.set(Map properties)- Set multiple properties..increment(String property, num value)- Increment a numeric value..append(String listName, dynamic value)- Append to an array.
EmpAnalytics.registerSuperProperties()
Registers properties that will be sent with every single track call automatically.
| Parameter | Type | Required | Description |
|---|---|---|---|
| properties | Map | Yes | Properties to attach. |