StreamAnalytics constructor

StreamAnalytics(
  1. String apiKey, {
  2. String? secret,
  3. Token? userToken,
  4. AnalyticsAPI? analytics,
  5. StreamHttpClientOptions? options,
})

StreamAnalytics constructor:

Sends out analytic events to the Stream service. We recommend tracking every event for each user. This allows you to gain a better understanding of that user's interests. Common examples include:

  • Clicking on a link
  • Liking or commenting
  • Sharing an activity
  • Viewing another user's profile page
  • Searching for a certain user/content/topic/etc.

Implementation

StreamAnalytics(
  String apiKey, {
  this.secret,
  this.userToken,
  AnalyticsAPI? analytics,
  StreamHttpClientOptions? options,
})  : assert(
        userToken != null || secret != null,
        'At least a secret or userToken must be provided',
      ),
      _analytics = analytics ?? AnalyticsAPI(apiKey, options: options);