@primexperts.co/pulse-agent 5.7.0 → 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/LICENSE CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -81,7 +81,7 @@ Use these values in your widget config:
81
81
  | API base URL | `https://pulse.service.primexperts.co.za` | Yes | Use the API URL shown by your Pulse environment. |
82
82
  | Website origin | `https://www.example.com` | Required for production | Add the exact site origin where the widget will run. |
83
83
 
84
- You usually do not need a widget token. Pulse Agent resolves it automatically from your organization slug; when an application key is configured, the agent also sends it for app-aware deployments and reporting context.
84
+ You usually do not need a widget token. Pulse Agent resolves it automatically from your organization slug; when an application key is configured, the agent also sends it for app-aware deployments and reporting context.
85
85
  ## Configuration Keys
86
86
 
87
87
  | Option | Type | Default | Description |
@@ -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
- ## Heroku Config Vars
143
+ ## Deployment Environment Variables
144
144
 
145
- Set these in Heroku under Settings -> Config Vars, or with the Heroku CLI:
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
- ```bash
148
- heroku config:set PULSE_AGENT_SLUG=your-organization-slug
149
- heroku config:set PULSE_AGENT_APP_KEY=app_your_public_application_key
150
- heroku config:set PULSE_AGENT_API_BASE_URL=https://pulse.service.primexperts.co.za
151
- heroku config:set PULSE_AGENT_TITLE=Support
152
- heroku config:set PULSE_AGENT_ENVIRONMENT=production
153
- heroku config:set PULSE_AGENT_ERROR_MONITORING=true
154
- heroku config:set PULSE_AGENT_CAPTURE_UNHANDLED_ERRORS=true
155
- heroku config:set PULSE_AGENT_CAPTURE_UNHANDLED_REJECTIONS=true
156
- heroku config:set PULSE_AGENT_CAPTURE_FETCH_ERRORS=true
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, make sure Heroku serves that file from environment values at request time or regenerates it during build/startup.
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
 
@@ -172,7 +172,7 @@ Structure your app so `createPulseAgent(...)` runs:
172
172
 
173
173
  Do not initialize Pulse Agent inside frequently re-rendered child components, route components that mount repeatedly, button click handlers, or server-only files. If the root component can unmount, keep the returned handle and call `agent.destroy()` during cleanup.
174
174
 
175
- For error monitoring, timing matters: errors that happen before `createPulseAgent(...)` runs cannot be captured by Pulse Agent. If you want broad coverage, load runtime config first and initialize Pulse Agent before bootstrapping the rest of the application where your framework allows it.
175
+ For error monitoring, timing matters: errors that happen before `createPulseAgent(...)` runs cannot be captured by Pulse Agent. If you want broad coverage, load runtime config first and initialize Pulse Agent before bootstrapping the rest of the application where your framework allows it.
176
176
  ## Runtime Config Pattern
177
177
 
178
178
  A common production-safe pattern is to load `/runtime-config.js` before your app bundle:
@@ -334,7 +334,7 @@ Pulse Agent is a browser widget, so it uses standard browser networking APIs to
334
334
  - `EventSource` keeps the chat connected for realtime replies.
335
335
  - Optional `fetch` wrapping reports failed website requests only when `errorMonitoring` and `captureFetchErrors` are enabled.
336
336
 
337
- The package does not run install scripts, does not start background processes, does not open arbitrary sockets, and does not use Node filesystem or shell APIs at runtime. Network calls are made from the visitor's browser after the website initializes `createPulseAgent(...)`, and they target the configured `apiBaseUrl` plus optional WhatsApp links when configured.
337
+ The package does not run install scripts, does not start background processes, does not open arbitrary sockets, and does not use Node filesystem or shell APIs at runtime. Network calls are made from the visitor's browser after the website initializes `createPulseAgent(...)`, and they target the configured `apiBaseUrl` plus optional WhatsApp links when configured.
338
338
  ## Error Monitoring
339
339
 
340
340
  Error monitoring is opt-in. Installing the package does not capture anything until `errorMonitoring: true` is passed to `createPulseAgent`.
@@ -400,10 +400,10 @@ 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, which is useful for Heroku, Docker, static hosting, and multi-environment deployments.
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
- - 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
- - 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.
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
+ - 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.
407
407
  - Supports role-based team operation: admins manage setup and assignment, while agents work assigned conversations.
408
408
 
409
409
  ## Limitations
@@ -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
+
@@ -91,7 +91,7 @@ Pulse Agent is a browser widget, so it uses standard browser networking APIs to
91
91
  - `EventSource` keeps the chat connected for realtime replies.
92
92
  - Optional `fetch` wrapping reports failed website requests only when `errorMonitoring` and `captureFetchErrors` are enabled.
93
93
 
94
- The package does not run install scripts, does not start background processes, does not open arbitrary sockets, and does not use Node filesystem or shell APIs at runtime. Network calls are made from the visitor's browser after the website initializes `createPulseAgent(...)`, and they target the configured `apiBaseUrl` plus optional WhatsApp links when configured.
94
+ The package does not run install scripts, does not start background processes, does not open arbitrary sockets, and does not use Node filesystem or shell APIs at runtime. Network calls are made from the visitor's browser after the website initializes `createPulseAgent(...)`, and they target the configured `apiBaseUrl` plus optional WhatsApp links when configured.
95
95
  ## 5. Error Monitoring Configuration
96
96
 
97
97
  Error monitoring is off by default. Enable it explicitly:
@@ -143,7 +143,7 @@ try {
143
143
 
144
144
  ## 6. Environment Variable Names
145
145
 
146
- Use these names in Heroku, Docker, CI, or your hosting platform:
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
@@ -187,7 +187,7 @@ Structure your app so `createPulseAgent(...)` runs:
187
187
 
188
188
  Do not initialize Pulse Agent inside frequently re-rendered child components, route components that mount repeatedly, button click handlers, or server-only files. If the root component can unmount, keep the returned handle and call `agent.destroy()` during cleanup.
189
189
 
190
- For error monitoring, timing matters: errors that happen before `createPulseAgent(...)` runs cannot be captured by Pulse Agent. If you want broad coverage, load runtime config first and initialize Pulse Agent before bootstrapping the rest of the application where your framework allows it.
190
+ For error monitoring, timing matters: errors that happen before `createPulseAgent(...)` runs cannot be captured by Pulse Agent. If you want broad coverage, load runtime config first and initialize Pulse Agent before bootstrapping the rest of the application where your framework allows it.
191
191
  ## 7. Runtime Config Setup
192
192
 
193
193
  Frontend bundles usually cannot read platform environment variables directly at runtime. Use a runtime config file generated from environment variables.
@@ -240,23 +240,23 @@ if (pulseAgentConfig?.slug) {
240
240
  }
241
241
  ```
242
242
 
243
- ## 8. Heroku Setup
243
+ ## 8. Deployment Setup
244
244
 
245
- Set config vars:
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
- ```bash
248
- heroku config:set PULSE_AGENT_SLUG=acme-support
249
- heroku config:set PULSE_AGENT_APP_KEY=app_your_public_application_key
250
- heroku config:set PULSE_AGENT_API_BASE_URL=https://pulse.service.primexperts.co.za
251
- heroku config:set PULSE_AGENT_TITLE=Acme Support
252
- heroku config:set PULSE_AGENT_ENVIRONMENT=production
253
- heroku config:set PULSE_AGENT_ERROR_MONITORING=true
254
- heroku config:set PULSE_AGENT_CAPTURE_UNHANDLED_ERRORS=true
255
- heroku config:set PULSE_AGENT_CAPTURE_UNHANDLED_REJECTIONS=true
256
- heroku config:set PULSE_AGENT_CAPTURE_FETCH_ERRORS=true
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 your app uses a generated `public/runtime-config.js`, run the generator during build or startup. If your app serves `/runtime-config.js` from Node/Express, read `process.env` and emit the config response at request time.
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 Heroku and similar platforms.
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
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primexperts.co/pulse-agent",
3
- "version": "5.7.0",
3
+ "version": "5.7.2",
4
4
  "description": "Embeddable Pulse floating chat agent widget.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",