initialize static method

void initialize({
  1. String tableName = 'analytics',
  2. bool useLoggedUserInfo = true,
  3. bool logUserSignIn = true,
  4. String? userCountry,
})

Initialize the analytics addons

Implementation

static void initialize({
  String tableName = 'analytics',
  bool useLoggedUserInfo = true,
  bool logUserSignIn = true,
  String? userCountry,
}) {
  if (logUserSignIn) {
    _authListener = SupabaseAuthAddons.onAuthStateChange.listen((event) {
      if (event == AuthChangeEvent.signedIn) {
        SupabaseAnalyticsAddons.logUserSession();
      }
    });
  }

  SupabaseAnalyticsAddons.userCountry = userCountry;
  _analyticsTableName = tableName;
  _useLoggedUserInfo = useLoggedUserInfo;
  _isInitialized = true;
}