@mushi-mushi/web 1.34.0 → 1.35.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/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  A bug widget for any website. When a user reports a problem, it sends a screenshot, the route, their note and the last console and network events to [Mushi Mushi](https://github.com/kensaurus/mushi-mushi). Mushi Mushi explains the cause in plain English and hands your editor a fix. It renders in a Shadow DOM, so your CSS and the widget's never mix.
6
6
 
7
+ The same code ships in the [`mushi-mushi`](https://www.npmjs.com/package/mushi-mushi) package: `npm install mushi-mushi`, then `import { Mushi } from 'mushi-mushi'`. This package keeps working and keeps getting updates.
8
+
7
9
  ```mermaid
8
10
  flowchart LR
9
11
  A["User taps the widget"] --> B["Mushi Mushi diagnoses the bug"] --> C["Fix lands in your editor"]
@@ -12,12 +14,13 @@ flowchart LR
12
14
  ## Quick start
13
15
 
14
16
  ```bash
15
- npx mushi-mushi # wizard: picks the right SDK, installs it, writes env vars
16
- # or: npm install @mushi-mushi/web
17
+ npm install mushi-mushi # then import from 'mushi-mushi'
18
+ # or: npx mushi-mushi # wizard: picks the right SDK, installs it, writes env vars
19
+ # or: npm install @mushi-mushi/web # same code; import from '@mushi-mushi/web'
17
20
  ```
18
21
 
19
22
  ```ts
20
- import { Mushi } from '@mushi-mushi/web';
23
+ import { Mushi } from 'mushi-mushi';
21
24
 
22
25
  Mushi.init({
23
26
  projectId: '00000000-0000-0000-0000-000000000000', // from the console's Manage apps page
package/dist/index.cjs CHANGED
@@ -6834,7 +6834,7 @@ function createProactiveManager(config = {}) {
6834
6834
 
6835
6835
  // src/version.ts
6836
6836
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
6837
- var MUSHI_SDK_VERSION = "1.34.0" ;
6837
+ var MUSHI_SDK_VERSION = "1.35.0" ;
6838
6838
  function resolveReportAppVersion(config, environment) {
6839
6839
  if (config.appVersion) return config.appVersion;
6840
6840
  const vercelId = config.integrations?.vercel?.analyticsId;
@@ -7705,7 +7705,6 @@ function createInstance(config) {
7705
7705
  });
7706
7706
  function applyRuntimeConfig(runtime) {
7707
7707
  runtimeConfigLoaded = true;
7708
- if (runtime.enabled !== false) maybeStartSessionTracking(runtime.journeys ?? null);
7709
7708
  reporterNotificationsEnabled = runtime.reporterNotificationsEnabled !== false;
7710
7709
  reporterOffer = runtime.enabled === false ? null : runtime.reporter ?? null;
7711
7710
  syncReporterChannels();
@@ -7728,10 +7727,11 @@ function createInstance(config) {
7728
7727
  if (shouldUseRuntimeConfig(config)) {
7729
7728
  const cached = readCachedRuntimeConfig(config.projectId);
7730
7729
  if (cached) applyRuntimeConfig(cached);
7731
- apiClient2.getSdkConfig().then((result) => {
7730
+ apiClient2.getSdkConfig(trackSessionsMode === "on-demand" ? { fresh: true } : void 0).then((result) => {
7732
7731
  if (result.ok && result.data) {
7733
7732
  cacheRuntimeConfig(config.projectId, result.data);
7734
7733
  applyRuntimeConfig(result.data);
7734
+ if (result.data.enabled !== false) maybeStartSessionTracking(result.data.journeys ?? null);
7735
7735
  } else if (result.error) {
7736
7736
  log.debug("Runtime SDK config unavailable", result.error);
7737
7737
  }
@@ -8079,6 +8079,7 @@ function createInstance(config) {
8079
8079
  },
8080
8080
  updateConfig(runtimeConfig) {
8081
8081
  applyRuntimeConfig(runtimeConfig);
8082
+ if (runtimeConfig.enabled !== false) maybeStartSessionTracking(runtimeConfig.journeys ?? null);
8082
8083
  },
8083
8084
  diagnose() {
8084
8085
  return runDiagnostics({