@nexly/react-web 0.12.1 → 0.14.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.
Files changed (2) hide show
  1. package/README.md +11 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -43,7 +43,17 @@ function App() {
43
43
 
44
44
  - **`appId`**, **`ingestKey`** — required strings (`ingestKey` is the ingest API token; not named `key` because that is reserved in React).
45
45
  - **`autoPageView`** (default `false`) — when a client exists, send one pageview on mount.
46
- - **`autoEngagement`** (default `false`) — when **`true`** and a client exists (all three strings non-empty after trim), attach engagement listeners; otherwise no-op. Cleanup on unmount or when the client or flag changes.
46
+ - **`autoEngagement`** (default `false`) — when **`true`** and a client exists (all three strings non-empty after trim), attach engagement listeners; otherwise no-op. Cleanup on unmount or when the client or flag changes. The underlying `startEngagement()` is idempotent, so double-mounts (StrictMode, HMR) don't produce duplicate listeners.
47
+
48
+ ### Opting elements out of auto-capture
49
+
50
+ Mark any element with `data-nexly-ignore` to skip auto-`click` and auto-`input_focus` events for it (and its descendants). Use it on elements where you already emit your own `event(...)` to avoid semantic duplicates:
51
+
52
+ ```tsx
53
+ <button data-nexly-ignore onClick={() => client?.event({ name: 'signup_clicked', type: 'custom' })}>
54
+ Sign up
55
+ </button>
56
+ ```
47
57
 
48
58
  ### `useNexlyClient()`
49
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexly/react-web",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "React bindings for Nexly (@nexly/web): provider, client hook, engagement, optional auto pageview",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "react": "^18.0.0 || ^19.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@nexly/web": "0.12.1"
42
+ "@nexly/web": "0.14.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/react": "^19.2.14",