@mushi-mushi/web 1.24.0 → 1.25.0

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getReporterToken, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT, MUSHI_RADIUS, MUSHI_SPACING, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, normaliseThrown, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
1
+ import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT, MUSHI_RADIUS, MUSHI_SPACING, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, updateSessionIdentity, normaliseThrown, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
2
2
 
3
3
  // src/capture/compress-screenshot.ts
4
4
  async function compressScreenshotDataUrl(dataUrl, maxBytes = MAX_SCREENSHOT_DATA_URL_BYTES) {
@@ -2559,7 +2559,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
2559
2559
 
2560
2560
  // src/version.ts
2561
2561
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
2562
- var MUSHI_SDK_VERSION = "1.24.0" ;
2562
+ var MUSHI_SDK_VERSION = "1.25.0" ;
2563
2563
  var CATEGORY_ICONS = {
2564
2564
  bug: "\u26A0\uFE0F",
2565
2565
  slow: "\u{1F40C}",
@@ -7809,8 +7809,6 @@ function createProactiveManager(config = {}) {
7809
7809
  }
7810
7810
  return { shouldShow, recordDismissal, recordSubmission, reset };
7811
7811
  }
7812
-
7813
- // src/mushi.ts
7814
7812
  function resolveReportAppVersion(config, environment) {
7815
7813
  if (config.appVersion) return config.appVersion;
7816
7814
  const vercelId = config.integrations?.vercel?.analyticsId;
@@ -7873,6 +7871,13 @@ function createInstance(config) {
7873
7871
  sdkPackage: MUSHI_SDK_PACKAGE,
7874
7872
  sdkVersion: MUSHI_SDK_VERSION
7875
7873
  });
7874
+ if (bootstrapConfig["trackSessions"] !== false) {
7875
+ initSessionTracker({
7876
+ client: apiClient2,
7877
+ sdkVersion: MUSHI_SDK_VERSION,
7878
+ reporterTokenHash: getReporterToken(bootstrapConfig.projectId) ?? null
7879
+ });
7880
+ }
7876
7881
  const preFilter = createPreFilter(bootstrapConfig.preFilter);
7877
7882
  const offlineQueue = createOfflineQueue(bootstrapConfig.offline);
7878
7883
  const rateLimiter = createRateLimiter({ maxBurst: 10, refillRate: 1, refillIntervalMs: 5e3 });
@@ -8841,6 +8846,7 @@ function createInstance(config) {
8841
8846
  replayCap = null;
8842
8847
  offlineQueue.stopAutoSync();
8843
8848
  stopReporterInboxPolling();
8849
+ destroySessionTracker();
8844
8850
  breadcrumbs.clear();
8845
8851
  listeners.clear();
8846
8852
  instance = null;
@@ -8994,6 +9000,7 @@ function createInstance(config) {
8994
9000
  breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken() refreshed" });
8995
9001
  return;
8996
9002
  }
9003
+ updateSessionIdentity(claims.sub);
8997
9004
  userInfo = {
8998
9005
  id: claims.sub,
8999
9006
  ...claims.email ? { email: claims.email } : {},