@datalyr/web 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @datalyr/web v1.3.0
2
+ * @datalyr/web v1.4.1
3
3
  * Datalyr Web SDK - Modern attribution tracking for web applications
4
4
  * (c) 2026 Datalyr Inc.
5
5
  * Released under the MIT License
@@ -3702,10 +3702,18 @@ class Datalyr {
3702
3702
  }
3703
3703
  }
3704
3704
  /**
3705
- * Track a screen view (for SPAs)
3705
+ * Track a screen view (for SPAs).
3706
+ * Fires a `pageview` event with a `screen` property, consistent with
3707
+ * the React Native and iOS SDKs.
3706
3708
  */
3707
3709
  screen(screenName, properties = {}) {
3708
- this.track('screen_view', Object.assign({ screen_name: screenName }, properties));
3710
+ if (!this.initialized) {
3711
+ console.warn('[Datalyr] SDK not initialized. Call init() first.');
3712
+ return;
3713
+ }
3714
+ if (!this.shouldTrack())
3715
+ return;
3716
+ this.track('pageview', Object.assign({ screen: screenName }, properties));
3709
3717
  }
3710
3718
  /**
3711
3719
  * Associate user with a group/account
@@ -3927,7 +3935,7 @@ class Datalyr {
3927
3935
  resolution_method: 'browser_sdk',
3928
3936
  resolution_confidence: 1.0,
3929
3937
  // SDK metadata
3930
- sdk_version: '1.2.1',
3938
+ sdk_version: '1.4.1',
3931
3939
  sdk_name: 'datalyr-web-sdk'
3932
3940
  };
3933
3941
  return payload;