@primexperts.co/pulse-agent 5.2.0 → 5.3.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
@@ -36,6 +36,29 @@ const agent = createPulseAgent({
36
36
  agent.open();
37
37
  ```
38
38
 
39
+ ## Why Teams Use Pulse Agent
40
+
41
+ Pulse Agent is useful when a business has customer messages arriving through public-facing channels, but the team needs a controlled place to handle them.
42
+
43
+ Typical use cases:
44
+
45
+ - A website visitor starts a chat and any available team member can respond from Pulse.
46
+ - A support mailbox can be connected so the team manages customer email from a shared workspace instead of one person's inbox.
47
+ - Conversation history stays attached to the customer interaction, so the next team member can continue with context.
48
+ - Teams can separate customer communication by organization/application using the `slug` and `appKey`.
49
+ - Website errors can be reported into Pulse so support and operations can see when customers are affected.
50
+
51
+ The result is a team inbox model: one public channel for customers, multiple internal users for response and follow-up.
52
+
53
+ ## Channel Model
54
+
55
+ | Channel | Current role | What the customer sees | What the team gets in Pulse |
56
+ | --- | --- | --- | --- |
57
+ | Webchat | Supported through this package | Website chat launcher | Shared conversation thread, visitor profile, realtime replies, history, transcript action |
58
+ | Email | Supported by Pulse integrations | Normal support email address | Shared email conversations in Pulse, independent of one person's mailbox |
59
+ | WhatsApp | Planned/optional depending on deployment | WhatsApp contact path | Intended shared handling model when enabled; do not promise as active unless configured |
60
+ | Error Monitoring | Supported through this package | No visible customer UI | Browser exceptions and failed request reports tied to the website/application |
61
+
39
62
  ## What You Need From Pulse
40
63
 
41
64
  You need these values before going live:
@@ -261,7 +284,7 @@ onBeforeUnmount(() => agent?.destroy());
261
284
  At startup or first send, Pulse Agent calls:
262
285
 
263
286
  ```text
264
- GET /api/pulse/public/webchat/resolve?slug=<slug>&appKey=<app_...>
287
+ GET /api/pulse/public/webchat/resolve?slug=<slug>[&appKey=<app_...>]
265
288
  ```
266
289
 
267
290
  Pulse returns the active widget configuration, including an internal `widgetToken`. The widget then uses that token for chat, history, streaming, transcript email, and error reporting.
@@ -324,7 +347,7 @@ Pulse Agent does not:
324
347
  The widget expects these Pulse endpoints:
325
348
 
326
349
  ```text
327
- GET /api/pulse/public/webchat/resolve?slug=<slug>&appKey=<appKey>
350
+ GET /api/pulse/public/webchat/resolve?slug=<slug>[&appKey=<appKey>]
328
351
  POST /api/pulse/public/webchat/{widgetToken}/message
329
352
  GET /api/pulse/public/webchat/{widgetToken}/messages?conversationId=<id>
330
353
  POST /api/pulse/public/webchat/{widgetToken}/transcript-email?conversationId=<id>
@@ -341,7 +364,9 @@ Admin setup endpoints are separate and should remain authenticated.
341
364
  - Works with npm or a script tag.
342
365
  - Supports runtime configuration, which is useful for Heroku, Docker, static hosting, and multi-environment deployments.
343
366
  - Uses `slug` + `appKey` so users do not need to handle internal widget tokens.
344
- - Supports visitor profile capture, history loading, transcript email requests, SSE replies, WhatsApp launcher, manual open/close, and manual exception reporting.
367
+ - Supports visitor profile capture, history loading, transcript email requests, SSE replies, WhatsApp launcher/contact path where configured, manual open/close, and manual exception reporting.
368
+ - Supports operational workflows verified in the Pulse source: assignment, status/priority updates, internal notes, follow-ups, customer profiles, tags, notifications, activity logs, exports, and dashboard KPIs.
369
+ - Supports role-based team operation: admins manage setup and assignment, while agents work assigned conversations.
345
370
 
346
371
  ## Limitations
347
372
 
@@ -395,7 +420,7 @@ The public resolve endpoint is protected or the key is not accepted. Confirm the
395
420
 
396
421
  ### `Failed to resolve widget keys (404)`
397
422
 
398
- The slug is wrong, webchat is not enabled, or the selected application has no active widget.
423
+ The slug is wrong, Webchat is not enabled, or the selected organization/application has no active widget.
399
424
 
400
425
  ### CORS error in the browser console
401
426
 
@@ -412,34 +437,4 @@ Confirm all of the following:
412
437
  - `errorMonitoring: true` is present in runtime config.
413
438
  - The widget successfully resolves a widget token.
414
439
  - The error happens after `createPulseAgent(...)` runs.
415
- - The browser can post to `/api/pulse/public/webchat/{widgetToken}/errors`.
416
-
417
- ## Additional Documentation
418
-
419
- - `docs/IMPLEMENTATION-GUIDE.md` for end-to-end setup examples.
420
- - `docs/TROUBLESHOOTING.md` for diagnostics.
421
- - `docs/FAQ.md` for common questions.
422
- - `docs/INTEGRATION-CHANNELS.md` for channel-level implementation notes.
423
-
424
- ## Build and Publish
425
-
426
- ```bash
427
- npm run build
428
- npm publish --access public
429
- ```
430
-
431
- Build output includes:
432
-
433
- - ESM and type declarations in `dist/`.
434
- - Browser global bundle in `dist/browser/pulse-agent.global.js`.
435
-
436
- ## Versioning
437
-
438
- Use the built-in version script instead of editing package files manually:
439
-
440
- ```bash
441
- npm run version:patch
442
- npm run version:minor
443
- npm run version:major
444
- npm run version:bump -- 1.2.3
445
- ```
440
+ - The browser can post to `/api/pulse/public/webchat/{widgetToken}/errors`.
@@ -0,0 +1,42 @@
1
+ # Pulse Agent Developer Notes
2
+
3
+ This document is for maintainers of `@primexperts.co/pulse-agent`. It is not required for customers installing the widget.
4
+
5
+ ## Repository Documentation
6
+
7
+ - `docs/IMPLEMENTATION-GUIDE.md` - end-to-end setup examples and deployment guidance.
8
+ - `docs/TROUBLESHOOTING.md` - diagnostics for CORS, resolve failures, streaming, and monitoring.
9
+ - `docs/FAQ.md` - common integration questions.
10
+ - `docs/INTEGRATION-CHANNELS.md` - channel-level implementation notes.
11
+
12
+ ## Build
13
+
14
+ ```bash
15
+ npm run build
16
+ ```
17
+
18
+ Build output includes:
19
+
20
+ - ESM and type declarations in `dist/`.
21
+ - Browser global bundle in `dist/browser/pulse-agent.global.js`.
22
+
23
+ ## Publish
24
+
25
+ ```bash
26
+ npm publish --access public
27
+ ```
28
+
29
+ `prepublishOnly` runs the build before publishing.
30
+
31
+ ## Versioning
32
+
33
+ Use the built-in version script instead of editing package files manually:
34
+
35
+ ```bash
36
+ npm run version:patch
37
+ npm run version:minor
38
+ npm run version:major
39
+ npm run version:bump -- 1.2.3
40
+ ```
41
+
42
+ This updates both `package.json` and `package-lock.json` when the script is used.
@@ -1,6 +1,6 @@
1
1
  # Pulse Agent Implementation Guide
2
2
 
3
- This guide explains how to add Pulse Agent to a website, configure it from environment variables, enable browser error monitoring, and verify the integration before production release.
3
+ This guide explains how to add Pulse Agent to a website, configure it from environment variables, enable browser error monitoring, and verify the integration before production release. It also explains the bigger product model: Pulse Agent is the website entry point into a shared Pulse workspace where multiple users can manage customer conversations from connected channels.
4
4
 
5
5
  ## 1. What Pulse Agent Does
6
6
 
@@ -12,23 +12,38 @@ Pulse Agent is a browser widget for public websites. It provides:
12
12
  - Conversation history loading.
13
13
  - Realtime replies through Server-Sent Events.
14
14
  - Optional transcript/follow-up email action.
15
- - Optional WhatsApp launcher.
15
+ - Optional WhatsApp launcher/contact path where configured; full WhatsApp shared-inbox handling should be described only when enabled for that deployment.
16
16
  - Optional website error monitoring for browser exceptions and failed fetch calls.
17
17
 
18
18
  Installing the package only makes the code available. The widget and error monitoring start only after your app calls `createPulseAgent(...)` with valid configuration.
19
19
 
20
+ ## 1.1. Source-Verified Product Capabilities
21
+
22
+ The Pulse source supports more than a website chat bubble:
23
+
24
+ - Authenticated Pulse users can work from an Inbox.
25
+ - Admins can assign or reassign conversations.
26
+ - Agents are assignment-scoped in the current role model.
27
+ - Team members can reply to conversations and add internal notes.
28
+ - Conversations support status, priority, activity, tags, follow-ups, quotes, and customer profiles.
29
+ - Dashboard views show open/pending conversations, team load, and error summaries.
30
+ - Email integrations can connect an inbox through IMAPS polling and convert unread mail into Pulse conversations.
31
+ - Webchat uses public visitor endpoints, rate limiting, history, and SSE streaming.
32
+ - Error monitoring can post browser error reports to Pulse and feed dashboard summaries.
33
+
34
+ This is why the strongest positioning is: Pulse Agent gets the customer conversation or browser issue into Pulse; Pulse gives the team a controlled workspace to manage it together.
20
35
  ## 2. Required Pulse Values
21
36
 
22
37
  | Value | Required | Example | Notes |
23
38
  | --- | --- | --- | --- |
24
39
  | `slug` | Yes | `vayakids` | Public organization slug. |
25
- | `appKey` | Recommended | `app_abc123...` | Public application key from Pulse Dashboard. |
40
+ | `appKey` | Recommended | `app_abc123...` | Public application key from Pulse Dashboard. The agent sends it when present; app-aware Pulse deployments can use it for application separation and reporting context. |
26
41
  | `apiBaseUrl` | Yes | `https://pulse.service.primexperts.co.za` | Host only; do not add `/api`. |
27
42
  | Website origin | Yes | `https://app.example.com` | Must be allowed by Pulse CORS/backend configuration. |
28
43
 
29
44
  The `appKey` is the value that starts with `app_`. It is not the same as `widgetToken`.
30
45
 
31
- A `widgetToken` is normally resolved automatically by Pulse. Do not configure it unless Pulse explicitly provides a token for a special case.
46
+ A `widgetToken` is normally resolved automatically by Pulse from the organization `slug`; when `appKey` is configured, the agent also sends it for app-aware deployments. Do not configure `widgetToken` unless Pulse explicitly provides a token for a special case.
32
47
 
33
48
  ## 3. Install
34
49
 
@@ -235,7 +250,7 @@ Use the browser global bundle and call `window.PulseAgent.createPulseAgent(...)`
235
250
  Pulse Agent calls these public endpoints:
236
251
 
237
252
  ```text
238
- GET /api/pulse/public/webchat/resolve?slug=<slug>&appKey=<appKey>
253
+ GET /api/pulse/public/webchat/resolve?slug=<slug>[&appKey=<appKey>]
239
254
  POST /api/pulse/public/webchat/{widgetToken}/message
240
255
  GET /api/pulse/public/webchat/{widgetToken}/messages?conversationId=<id>
241
256
  POST /api/pulse/public/webchat/{widgetToken}/transcript-email?conversationId=<id>
@@ -270,7 +285,7 @@ These endpoints are public by design for website visitors. Admin setup endpoints
270
285
  ## 13. Verification Checklist
271
286
 
272
287
  1. Open the site and confirm the Pulse launcher appears.
273
- 2. In browser dev tools, confirm `resolve?slug=...&appKey=...` succeeds.
288
+ 2. In browser dev tools, confirm `resolve?slug=...` succeeds; if your deployment uses app keys, confirm `appKey=...` is included.
274
289
  3. Send a test message and confirm `message` succeeds.
275
290
  4. Confirm `stream` is open and receives replies.
276
291
  5. If history is enabled, confirm `messages?conversationId=...` succeeds.
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@primexperts.co/pulse-agent",
3
- "version": "5.2.0",
4
- "description": "Embeddable Pulse floating chat agent widget.",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "docs",
17
- "README.md",
18
- "LICENSE"
19
- ],
20
- "scripts": {
21
- "clean": "node -e \"if(require('fs').existsSync('dist')) require('fs').rmSync('dist',{recursive:true,force:true})\"",
22
- "build:types": "tsc -p tsconfig.build.json",
23
- "build:browser": "node scripts/build-browser-global.mjs",
24
- "build": "npm run clean && npm run build:types && npm run build:browser",
25
- "version:bump": "node scripts/bump-version.mjs",
26
- "version:patch": "node scripts/bump-version.mjs patch",
27
- "version:minor": "node scripts/bump-version.mjs minor",
28
- "version:major": "node scripts/bump-version.mjs major",
29
- "prepublishOnly": "npm run build"
30
- },
31
- "private": false,
32
- "license": "MIT",
33
- "author": "PrimExperts",
34
- "dependencies": {
35
- "tslib": "^2.8.1"
36
- },
37
- "devDependencies": {
38
- "typescript": "~5.8.2"
39
- }
40
- }
1
+ {
2
+ "name": "@primexperts.co/pulse-agent",
3
+ "version": "5.3.0",
4
+ "description": "Embeddable Pulse floating chat agent widget.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "docs",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "clean": "node -e \"if(require('fs').existsSync('dist')) require('fs').rmSync('dist',{recursive:true,force:true})\"",
22
+ "build:types": "tsc -p tsconfig.build.json",
23
+ "build:browser": "node scripts/build-browser-global.mjs",
24
+ "build": "npm run clean && npm run build:types && npm run build:browser",
25
+ "version:bump": "node scripts/bump-version.mjs",
26
+ "version:patch": "node scripts/bump-version.mjs patch",
27
+ "version:minor": "node scripts/bump-version.mjs minor",
28
+ "version:major": "node scripts/bump-version.mjs major",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "private": false,
32
+ "license": "MIT",
33
+ "author": "PrimExperts",
34
+ "dependencies": {
35
+ "tslib": "^2.8.1"
36
+ },
37
+ "devDependencies": {
38
+ "typescript": "~5.8.2"
39
+ }
40
+ }