Skip to content

Commit

Permalink
feat: added initial changes for user session feature on web platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Desu Sai Venkat committed Nov 22, 2023
1 parent 07a03d3 commit 9844c37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/plugins/rudder_plugin_web/lib/internal/web_js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ external group(String groupId, dynamic traits, dynamic options);
@JS("rudderanalytics.reset")
external reset(bool clearAnonymousId);

@JS("rudderanalytics.startSession")
external startSession(int? sessionId);

@JS("rudderanalytics.endSession")
external endSession();

@JS("rudderanalytics.getAnonymousId")
external String? getAnonymousId();

Expand Down
10 changes: 10 additions & 0 deletions packages/plugins/rudder_plugin_web/lib/rudder_plugin_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ class RudderSdkFlutterWeb extends RudderSdkPlatform {
web_js.setAnonymousId(anonymousId);
}

@override
void startSession({int? sessionId}) {
web_js.startSession(sessionId);
}

@override
void endSession() {
web_js.endSession();
}

@override
Future<Map?> getRudderContext() async {
return {
Expand Down

0 comments on commit 9844c37

Please sign in to comment.