@xapp/stentor-chat-widget 1.81.0 → 1.81.5

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.
Files changed (2) hide show
  1. package/lib/WidgetEnv.d.ts +17 -0
  2. package/package.json +7 -7
@@ -87,6 +87,23 @@ export interface ServerConfig {
87
87
  * Optional nonce used to trigger reconnection when the chat is reset
88
88
  */
89
89
  readonly nonce?: string;
90
+ /**
91
+ * Delay in milliseconds before closing WebSocket connection when page is backgrounded.
92
+ * Only applies to "websocketraw" connection type. Defaults to 60,000 (60 seconds).
93
+ * This prevents losing responses if user quickly switches tabs.
94
+ *
95
+ * @remarks
96
+ * - Set to 0 to disable delay (closes immediately on background)
97
+ * - Recommended range: 30000-300000 (30 seconds to 5 minutes)
98
+ * - Higher values keep connections open longer but use more server resources
99
+ * - The widget sends "user backgrounded" event immediately when tab loses focus
100
+ * - The widget sends "user foregrounded" event when user returns to tab
101
+ * - If user returns before delay expires, connection stays open
102
+ * - If delay expires, WebSocket closes and reconnects when user returns
103
+ *
104
+ * @default 60000
105
+ */
106
+ readonly backgroundSleepDelay?: number;
90
107
  }
91
108
  /**
92
109
  * Environment settings for the Widget
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.81.0",
7
+ "version": "1.81.5",
8
8
  "description": "Chat Widget channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -24,21 +24,21 @@
24
24
  "mocha": "9.2.2",
25
25
  "sinon": "13.0.2",
26
26
  "sinon-chai": "3.7.0",
27
- "stentor-models": "1.66.25",
27
+ "stentor-models": "1.66.41",
28
28
  "ts-node": "10.9.2",
29
29
  "typescript": "5.9.3"
30
30
  },
31
31
  "dependencies": {
32
- "stentor-constants": "1.66.25",
33
- "stentor-guards": "1.66.25"
32
+ "stentor-constants": "1.66.41",
33
+ "stentor-guards": "1.66.41"
34
34
  },
35
35
  "peerDependencies": {
36
- "react": ">=16.8.0",
37
- "stentor-models": "1.x"
36
+ "react": "^18.0.0 || ^19.0.0",
37
+ "stentor-models": "^1.0.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsc -d true -p .",
41
41
  "clean": "rm -rf ./lib/*"
42
42
  },
43
- "gitHead": "a568a993d4a16b6f87eea5c8870e0888f883959b"
43
+ "gitHead": "46fdf2272da696e47a7dcb886bb5815d60abcc5f"
44
44
  }