@primexperts.co/pulse-agent 5.7.1 → 5.7.2
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 +16 -15
- package/docs/IMPLEMENTATION-GUIDE.md +18 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,23 +140,23 @@ PULSE_AGENT_WIDGET_TOKEN=
|
|
|
140
140
|
|
|
141
141
|
Leave `PULSE_AGENT_WIDGET_TOKEN` unset unless Pulse Support explicitly gives you one. It is not the `app_*` key.
|
|
142
142
|
|
|
143
|
-
##
|
|
143
|
+
## Deployment Environment Variables
|
|
144
144
|
|
|
145
|
-
Set
|
|
145
|
+
Set the same values in whatever platform you deploy on. The host should provide them as environment variables during build or at runtime, and your app should expose them to the browser through a runtime config file or server-rendered bootstrap.
|
|
146
146
|
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
```env
|
|
148
|
+
PULSE_AGENT_SLUG=your-organization-slug
|
|
149
|
+
PULSE_AGENT_APP_KEY=app_your_public_application_key
|
|
150
|
+
PULSE_AGENT_API_BASE_URL=https://pulse.service.primexperts.co.za
|
|
151
|
+
PULSE_AGENT_TITLE=Support
|
|
152
|
+
PULSE_AGENT_ENVIRONMENT=production
|
|
153
|
+
PULSE_AGENT_ERROR_MONITORING=true
|
|
154
|
+
PULSE_AGENT_CAPTURE_UNHANDLED_ERRORS=true
|
|
155
|
+
PULSE_AGENT_CAPTURE_UNHANDLED_REJECTIONS=true
|
|
156
|
+
PULSE_AGENT_CAPTURE_FETCH_ERRORS=true
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
If your app uses a `runtime-config.js` file,
|
|
159
|
+
If your app uses a `runtime-config.js` file, generate that file from environment values at request time, build time, or startup depending on how your host serves assets.
|
|
160
160
|
|
|
161
161
|
## Required Code Structure
|
|
162
162
|
|
|
@@ -400,7 +400,7 @@ Admin setup endpoints are separate and should remain authenticated.
|
|
|
400
400
|
- One package for webchat and optional browser error monitoring.
|
|
401
401
|
- Framework-agnostic browser integration.
|
|
402
402
|
- Works with npm or a script tag.
|
|
403
|
-
- Supports runtime configuration
|
|
403
|
+
- Supports runtime configuration for static hosting, server-rendered apps, containerized apps, and other multi-environment deployments.
|
|
404
404
|
- Uses the organization `slug`, plus `appKey` when available, so users do not need to handle internal widget tokens.
|
|
405
405
|
- Supports visitor profile capture, history loading, transcript email requests, SSE replies, WhatsApp launcher/contact path where configured, manual open/close, and manual exception reporting.
|
|
406
406
|
- 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.
|
|
@@ -475,4 +475,5 @@ Confirm all of the following:
|
|
|
475
475
|
- `errorMonitoring: true` is present in runtime config.
|
|
476
476
|
- The widget successfully resolves a widget token.
|
|
477
477
|
- The error happens after `createPulseAgent(...)` runs.
|
|
478
|
-
- The browser can post to `/api/pulse/public/webchat/{widgetToken}/errors`.
|
|
478
|
+
- The browser can post to `/api/pulse/public/webchat/{widgetToken}/errors`.
|
|
479
|
+
|
|
@@ -143,7 +143,7 @@ try {
|
|
|
143
143
|
|
|
144
144
|
## 6. Environment Variable Names
|
|
145
145
|
|
|
146
|
-
Use these names in
|
|
146
|
+
Use these names in your platform environment, secret store, or deployment settings:
|
|
147
147
|
|
|
148
148
|
```env
|
|
149
149
|
PULSE_AGENT_SLUG=acme-support
|
|
@@ -240,23 +240,23 @@ if (pulseAgentConfig?.slug) {
|
|
|
240
240
|
}
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
## 8.
|
|
243
|
+
## 8. Deployment Setup
|
|
244
244
|
|
|
245
|
-
Set config
|
|
245
|
+
Set the same values in your host environment, secret store, or deployment settings. The exact mechanism depends on your platform, but the goal is the same: make the values available to the server or build pipeline, then expose them to the browser through a runtime config file or equivalent bootstrap.
|
|
246
246
|
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
247
|
+
```env
|
|
248
|
+
PULSE_AGENT_SLUG=acme-support
|
|
249
|
+
PULSE_AGENT_APP_KEY=app_your_public_application_key
|
|
250
|
+
PULSE_AGENT_API_BASE_URL=https://pulse.service.primexperts.co.za
|
|
251
|
+
PULSE_AGENT_TITLE=Acme Support
|
|
252
|
+
PULSE_AGENT_ENVIRONMENT=production
|
|
253
|
+
PULSE_AGENT_ERROR_MONITORING=true
|
|
254
|
+
PULSE_AGENT_CAPTURE_UNHANDLED_ERRORS=true
|
|
255
|
+
PULSE_AGENT_CAPTURE_UNHANDLED_REJECTIONS=true
|
|
256
|
+
PULSE_AGENT_CAPTURE_FETCH_ERRORS=true
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
If
|
|
259
|
+
If you generate a runtime config file, make sure the host serves it from environment values at request time or rebuilds it during startup.
|
|
260
260
|
|
|
261
261
|
## 9. Framework Notes
|
|
262
262
|
|
|
@@ -300,7 +300,7 @@ These endpoints are public by design for website visitors. Admin setup endpoints
|
|
|
300
300
|
- One small browser package for chat and optional error reporting.
|
|
301
301
|
- No visitor login required.
|
|
302
302
|
- No need for customers to manage internal widget tokens.
|
|
303
|
-
- Supports runtime config for
|
|
303
|
+
- Supports runtime config for static hosting, server-rendered apps, containerized apps, and other multi-environment deployments.
|
|
304
304
|
- Works with npm, module bundlers, or a CDN script tag.
|
|
305
305
|
- Supports multiple frontend frameworks.
|
|
306
306
|
- Uses standard browser APIs: `fetch`, `EventSource`, and DOM events.
|
|
@@ -356,4 +356,6 @@ Check organization slug, app key, and whether Webchat is enabled for the selecte
|
|
|
356
356
|
|
|
357
357
|
### Resolve returns 401 or 403
|
|
358
358
|
|
|
359
|
-
Check whether the public resolve route is accessible and whether the app key is valid.
|
|
359
|
+
Check whether the public resolve route is accessible and whether the app key is valid.
|
|
360
|
+
|
|
361
|
+
|