@shiva004/surveys 0.10.0 → 0.11.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 +34 -0
- package/dist/elements.d.ts +3 -0
- package/dist/elements.js +9454 -10061
- package/dist/events/data.d.ts +6 -0
- package/dist/events/snapshots.d.ts +12 -0
- package/dist/experiments/ExperimentsApp.d.ts +8 -0
- package/dist/experiments/data.d.ts +129 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +7308 -7919
- package/dist/monitoring/MonitoringApp.d.ts +8 -0
- package/dist/monitoring/data.d.ts +108 -0
- package/dist/store.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +12 -6
package/README.md
CHANGED
|
@@ -83,6 +83,40 @@ Events are DOM `CustomEvent`s (callback data is in `event.detail`). For props th
|
|
|
83
83
|
|
|
84
84
|
Tip: if your TypeScript setup has `skipLibCheck: false`, install `@types/react` as a dev dependency (the type definitions mention React). Angular projects use `skipLibCheck: true` by default, so nothing is needed.
|
|
85
85
|
|
|
86
|
+
## What changed in 0.11.0
|
|
87
|
+
|
|
88
|
+
- New `startSnapshotReporting()` (React) / `startSurveys({ events: { endpoint } })` (Angular, on automatically): every 15-30 s and when the tab is hidden, an `environment_snapshot` event (browser, network, storage key counts) and a `heatmap_summary` event (per page: visits, active time, clicks, scroll depth, top elements) go to your endpoint. IP, ISP and location only with `includeIp: true`.
|
|
89
|
+
- Dummy backend: `node mock-api-server.mjs` (repo root). Same URLs as a real API would need: `POST /events`, `GET /sessions`, `GET /errors`.
|
|
90
|
+
|
|
91
|
+
- Every event sent to your API now carries a `context` object: browser, OS, screen, viewport, timezone, network type, CPU / memory and your own fields. A problem can be matched to the tester's laptop. No IP address, cookies or storage values are included. Switch off with `device: false`.
|
|
92
|
+
- `context` option: add your own fields to every event, e.g. `startEventCapture({ endpoint, context: { app: 'portal', release: '1.4.2', env: 'uat' } })`.
|
|
93
|
+
- Install fixes: `react` / `react-dom` are optional peers, so Angular and Vue apps (which use `/elements`) no longer download React. Bundled libraries (`rrweb`, `react-router-dom`, `lucide-react`) moved to `devDependencies`.
|
|
94
|
+
|
|
95
|
+
## What is sent to your API, and what is not
|
|
96
|
+
|
|
97
|
+
| Data | Goes to your API? | How |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Events: page views, clicks, JS errors, failed promises, `fetch` calls (status, duration), `console.error` / `console.warn`, your `trackEvent()` calls | **Yes** | `POST { events: [...] }` to the `endpoint` you pass to `startEventCapture` (batched, retried 3 times, sent on tab close) |
|
|
100
|
+
| Device / browser / network facts | **Yes** | in each event's `context` |
|
|
101
|
+
| `console.log` / `info` / `debug` lines | Only if you ask | `capture: { logs: { levels: ['ERROR', 'WARN', 'INFO'] } }` |
|
|
102
|
+
| Environment summary, heatmap summary | **Yes** (`environment_snapshot`, `heatmap_summary` events) | `startSnapshotReporting()` |
|
|
103
|
+
| IP, Wi-Fi name, individual storage values, full heatmap grid | **No** (stay in the browser) | |
|
|
104
|
+
| Session replay recordings (rrweb) | **No** (large, stay in the browser) | |
|
|
105
|
+
| Flags, Queues, Sessions, Rate Limit, Errors, Releases, Notifications, Mock API pages | They **read** from your API; they do not upload | see `LIVE_DATA.md` |
|
|
106
|
+
|
|
107
|
+
Event body:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{ "events": [ {
|
|
111
|
+
"id": "evt_8ac630be", "name": "js_error", "timestamp": "2026-11-25T08:55:45.851Z",
|
|
112
|
+
"source": "runtime", "user_id": "u_dd6dae43dd", "session_id": "s_ece2cdc473",
|
|
113
|
+
"properties": { "message": "boom", "file": "...", "line": 12, "col": 9 },
|
|
114
|
+
"context": { "app": "portal", "platform": "Windows", "user_agent": "...", "screen": "1920x1080", "timezone": "Asia/Kolkata", "network_type": "4g", "online": true }
|
|
115
|
+
} ] }
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Your server must accept `POST`, answer 2xx, and allow CORS for the app's origin (add `Authorization` to the allowed headers if you send a token). Try it locally with `node mock-api-server.mjs` from the repo root.
|
|
119
|
+
|
|
86
120
|
## What changed in 0.10.0
|
|
87
121
|
|
|
88
122
|
- New `@shiva004/surveys/elements` entry: all pages as web components for Angular, Vue and plain HTML, plus `defineSurveysElements()` and `startSurveys()`.
|
package/dist/elements.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import './styles.css';
|
|
16
16
|
import { startEventCapture } from './events/data';
|
|
17
|
+
import { type SnapshotOptions } from './events/snapshots';
|
|
17
18
|
export * from './index';
|
|
18
19
|
type Def = {
|
|
19
20
|
tag: string;
|
|
@@ -30,4 +31,6 @@ export declare const defineSurveysElements: () => void;
|
|
|
30
31
|
*/
|
|
31
32
|
export declare const startSurveys: (opts?: {
|
|
32
33
|
events?: Parameters<typeof startEventCapture>[0];
|
|
34
|
+
/** Send environment + heatmap summaries to the events endpoint. Default: on when `events.endpoint` is set. */
|
|
35
|
+
snapshots?: boolean | SnapshotOptions;
|
|
33
36
|
}) => () => void;
|