InvergeDocs
FlutterAPI reference

Sessions & identity

Sessions & identity in the Flutter SDK.

import 'package:nexus_flutter/nexus.dart';

NexusSessions

class

The sessions spine. identify names the end-user; track starts/refreshes the journey session other services correlate into.

View source

identify()

method
Future<void> identify(String distinctId, {String? email, String? name, String? phone, Map<String, Object?>? traits})

Identify the current end-user. All subsequent telemetry is attributed to it.

Parameters

Prop

Type

View source

track()

method
Future<String?> track({Map<String, Object?>? context})

Start/refresh the active session and return its server sessionId.

Parameters

Prop

Type

Returns Future<String?>

View source

reset()

method
Future<void> reset()

Forget the current user (e.g. on logout) and start a fresh session. Also clears the persisted identity, so subsequent launches start anonymous again.

View source

On this page