@shiva004/surveys 0.11.3 → 0.12.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 +4 -0
- package/dist/elements.d.ts +8 -0
- package/dist/elements.js +8236 -9777
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7181 -8716
- package/dist/recorder/startRecorder.d.ts +8 -0
- package/package.json +5 -8
package/README.md
CHANGED
|
@@ -57,6 +57,10 @@ startSurveys(); // capture events, lo
|
|
|
57
57
|
<surveys-flags project="my-app" (open-events)="go('events')"></surveys-flags> <!-- Angular -->
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
**Auto session recording (Angular / Vue / plain HTML):** `startSurveys()` now also starts the silent rrweb session recorder by itself when the page loads (no router needed, no click). It continues across reloads and saves to IndexedDB, so recordings show up in `<surveys-sessions>`. Options: `startSurveys({ recorder: { saveUrl, onSave, maxDurationMinutes, autoDownload } })`, or `recorder: false` to turn it off. Alternatively place `<surveys-recorder auto-start="true" save-url="..."></surveys-recorder>` once in your root template instead (do not use both).
|
|
61
|
+
|
|
62
|
+
**Auto session recording in React (same behavior):** call `startRecorder()` once at startup (`import { startRecorder } from '@shiva004/surveys'; startRecorder();` in `main.tsx`), or render `<RouteRecorderWatcher />` once anywhere (a router is optional). Import `@shiva004/surveys/style.css` once. Use only one of `startRecorder()`, `<RouteRecorderWatcher />`, `<surveys-recorder>` or `startSurveys()` (which calls `startRecorder` for you).
|
|
63
|
+
|
|
60
64
|
Angular: add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to the standalone component (or NgModule) that uses the tags. See `survey-angular-app/` for a complete example.
|
|
61
65
|
|
|
62
66
|
Import `configureFlags`, `trackEvent`, `createLogger` and the other functions from **`@shiva004/surveys/elements`** when you use the tags. They share state with the pages. (The React entry `@shiva004/surveys` is separate and keeps React external.)
|
package/dist/elements.d.ts
CHANGED
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import './styles.css';
|
|
16
|
+
import { type RouteRecorderWatcherProps } from './recorder/RouteRecorderWatcher';
|
|
16
17
|
import { startEventCapture } from './events/data';
|
|
17
18
|
import { type SnapshotOptions } from './events/snapshots';
|
|
18
19
|
export * from './index';
|
|
20
|
+
export type { RouteRecorderWatcherProps };
|
|
19
21
|
type Def = {
|
|
20
22
|
tag: string;
|
|
21
23
|
component: React.ComponentType<any>;
|
|
@@ -33,4 +35,10 @@ export declare const startSurveys: (opts?: {
|
|
|
33
35
|
events?: Parameters<typeof startEventCapture>[0];
|
|
34
36
|
/** Send environment + heatmap summaries to the events endpoint. Default: on when `events.endpoint` is set. */
|
|
35
37
|
snapshots?: boolean | SnapshotOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Silent session recording (rrweb). Default: ON, so a recording starts by itself when the page loads, continues across
|
|
40
|
+
* reloads and is saved to the All Sessions table. Pass false to switch off, or options (saveUrl, onSave, maxDurationMinutes, ...).
|
|
41
|
+
* Do not also add <surveys-recorder> when this is on.
|
|
42
|
+
*/
|
|
43
|
+
recorder?: boolean | RouteRecorderWatcherProps;
|
|
36
44
|
}) => () => void;
|