@zaplier/sdk 1.0.7 → 1.0.9

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.
package/dist/sdk.js CHANGED
@@ -5652,7 +5652,9 @@
5652
5652
  platform: (browser?.platform || "unknown").toLowerCase(),
5653
5653
  // PRIORITY 5: Device type (critical for differentiation, ultra-stable)
5654
5654
  deviceType,
5655
- // PRIORITY 6: Enhanced screen resolution buckets with 2024 display trends
5655
+ // PRIORITY 6: Enhanced screen resolution with exact dimensions for mobile differentiation
5656
+ // For mobile devices, we NEED exact dimensions to differentiate between similar models (S22 vs A54)
5657
+ // For desktop, bucketing is sufficient as hardware varies more
5656
5658
  screen: screen
5657
5659
  ? (() => {
5658
5660
  // Use enhanced screen buckets for modern display landscape
@@ -5747,6 +5749,19 @@
5747
5749
  return "enhanced"; // Slightly enhanced DPI
5748
5750
  return "standard"; // Standard 1x displays
5749
5751
  };
5752
+ // CRITICAL: Do NOT include exact dimensions in stableCoreVector for mobile!
5753
+ // Reason: Screen dimensions change when:
5754
+ // - Chrome address bar appears/disappears (scroll behavior)
5755
+ // - Virtual keyboard opens/closes
5756
+ // - Screen rotates (portrait ↔ landscape)
5757
+ // - Browser zoom changes
5758
+ // These changes would cause stableCoreHash to change, breaking visitor identification
5759
+ //
5760
+ // INSTEAD: Use ONLY stable screen characteristics (bucket, aspect, density)
5761
+ // For device differentiation (S22 vs A54), use:
5762
+ // - screenFrame (bezel measurements)
5763
+ // - Combination of bucket + hardware + display
5764
+ // - Vector similarity in IdentityResolver
5750
5765
  return {
5751
5766
  bucket: getScreenBucket(width),
5752
5767
  aspectClass: getAspectRatioClass(width, height),
@@ -5763,6 +5778,11 @@
5763
5778
  : width >= 768
5764
5779
  ? "tablet"
5765
5780
  : "mobile",
5781
+ // ❌ REMOVED: exact dimensions (causes instability on mobile)
5782
+ // Device differentiation is now handled by:
5783
+ // 1. screenFrame (bezel measurements - stable)
5784
+ // 2. hardware + display combination
5785
+ // 3. Vector similarity in IdentityResolver
5766
5786
  };
5767
5787
  })()
5768
5788
  : {
@@ -5891,7 +5911,18 @@
5891
5911
  : "none",
5892
5912
  };
5893
5913
  })(),
5894
- // PRIORITY 8: Enhanced color and display capabilities bucketing
5914
+ // PRIORITY 8: Screen frame (bezel measurements) for mobile device differentiation
5915
+ // CRITICAL: This is STABLE across page loads and provides device-specific fingerprint
5916
+ // Samsung S22 vs A54 have different screen frames despite similar resolutions
5917
+ screenFrame: deviceSignals$1?.screenFrame
5918
+ ? {
5919
+ top: deviceSignals$1.screenFrame.top || 0,
5920
+ right: deviceSignals$1.screenFrame.right || 0,
5921
+ bottom: deviceSignals$1.screenFrame.bottom || 0,
5922
+ left: deviceSignals$1.screenFrame.left || 0,
5923
+ }
5924
+ : undefined,
5925
+ // PRIORITY 9: Enhanced color and display capabilities bucketing
5895
5926
  display: (() => {
5896
5927
  const depth = deviceSignals$1.colorDepth;
5897
5928
  const gamut = deviceSignals$1.colorGamut;
@@ -5983,10 +6014,29 @@
5983
6014
  // - Exact hardware values (use buckets)
5984
6015
  // Generate ultra-stable hash with additional collision resistance
5985
6016
  const stableCoreHash = hashStableCore(coreVector, opts.debug);
5986
- // CRITICAL: Generate enhanced fingerprint hash combining unstable + stable components
5987
- // This prevents collisions by adding stable entropy to the fingerprint hash
6017
+ // CRITICAL: Generate enhanced fingerprint hash combining STABLE components only
6018
+ // Filter out unstable components that change between requests (canvas, webgl, audio)
6019
+ // These components can vary due to GPU state, rendering context, permissions, etc.
6020
+ const unstableComponentKeys = [
6021
+ "canvas",
6022
+ "webgl",
6023
+ "audio", // Visual/audio fingerprints (vary with context)
6024
+ "mathFingerprint",
6025
+ "fontPreferences",
6026
+ "enhancedFonts", // Measurement-based (can timeout/vary)
6027
+ "dateTimeLocale",
6028
+ "accessibilityEnhanced", // Locale/accessibility (can change)
6029
+ "domBlockers",
6030
+ "pluginsEnhanced", // Privacy tools detection (can change)
6031
+ ];
6032
+ const stableComponentValues = {};
6033
+ for (const [key, value] of Object.entries(componentValues)) {
6034
+ if (!unstableComponentKeys.includes(key)) {
6035
+ stableComponentValues[key] = value;
6036
+ }
6037
+ }
5988
6038
  const enhancedComponentValues = {
5989
- ...componentValues, // Unstable components (canvas, webgl, audio, etc.)
6039
+ ...stableComponentValues, // STABLE components only (screen, browser, system, etc.)
5990
6040
  _stableCore: coreVector, // + Ultra-stable components (ua, platform, deviceType, etc.)
5991
6041
  // REMOVED: _hourlyEntropy - was causing visitor ID instability (same user = different IDs)
5992
6042
  };