@wabbit-dashboard/embed 1.0.17 → 1.1.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.
- package/README.md +30 -0
- package/dist/wabbit-embed.cjs.js +459 -116
- package/dist/wabbit-embed.cjs.js.map +1 -1
- package/dist/wabbit-embed.d.ts +93 -42
- package/dist/wabbit-embed.esm.js +459 -116
- package/dist/wabbit-embed.esm.js.map +1 -1
- package/dist/wabbit-embed.umd.js +459 -116
- package/dist/wabbit-embed.umd.js.map +1 -1
- package/dist/wabbit-embed.umd.min.js +1 -1
- package/dist/wabbit-embed.umd.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,6 +127,34 @@ Wabbit.init({
|
|
|
127
127
|
});
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
### Session Persistence
|
|
131
|
+
|
|
132
|
+
Control whether chat sessions persist across browser sessions:
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
Wabbit.init({
|
|
136
|
+
apiKey: 'pk_live_xxx',
|
|
137
|
+
persistSession: true, // Default: sessions persist (uses localStorage)
|
|
138
|
+
chat: {
|
|
139
|
+
enabled: true,
|
|
140
|
+
collectionId: 'abc123'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Options:**
|
|
146
|
+
- `persistSession: true` (default) - Sessions persist across browser close/reopen using **localStorage**. Users can continue conversations after reopening the browser.
|
|
147
|
+
- `persistSession: false` - Sessions are cleared when browser closes using **sessionStorage**. Users start fresh each browser session, but conversations persist during page refreshes.
|
|
148
|
+
|
|
149
|
+
**Use Cases:**
|
|
150
|
+
- **Persistent (true)**: Customer support, ongoing consultations, learning platforms
|
|
151
|
+
- **Ephemeral (false)**: Sensitive data, temporary assistance, demo sites
|
|
152
|
+
|
|
153
|
+
**Technical Details:**
|
|
154
|
+
- `true`: Session ID stored in localStorage, survives browser restart
|
|
155
|
+
- `false`: Session ID stored in sessionStorage, cleared on browser close but survives page refresh
|
|
156
|
+
- Message history fetched from server on reconnect (not stored locally)
|
|
157
|
+
|
|
130
158
|
## Testing
|
|
131
159
|
|
|
132
160
|
### Option 1: Copy Embed Code from Dashboard (Recommended)
|
|
@@ -266,6 +294,7 @@ Initialize the Wabbit SDK.
|
|
|
266
294
|
**Parameters:**
|
|
267
295
|
- `config.apiKey` (string, required): Your Wabbit API key
|
|
268
296
|
- `config.apiUrl` (string, optional): API base URL (default: auto-detected)
|
|
297
|
+
- `config.persistSession` (boolean, optional): Whether to persist sessions across browser sessions (default: `true`)
|
|
269
298
|
- `config.chat` (ChatConfig, optional): Chat widget configuration
|
|
270
299
|
- `config.forms` (FormConfig, optional): Form widget configuration
|
|
271
300
|
- `config.emailCapture` (EmailCaptureConfig, optional): Email capture configuration
|
|
@@ -274,6 +303,7 @@ Initialize the Wabbit SDK.
|
|
|
274
303
|
```javascript
|
|
275
304
|
Wabbit.init({
|
|
276
305
|
apiKey: 'pk_live_xxx',
|
|
306
|
+
persistSession: true, // Optional: default is true
|
|
277
307
|
chat: { enabled: true, collectionId: 'abc123' }
|
|
278
308
|
});
|
|
279
309
|
```
|