@unisights/analytics 0.0.7 → 0.0.9
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 +9 -40
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -119,18 +119,15 @@ If you prefer to control when the SDK initializes, omit `data-insights-id` and c
|
|
|
119
119
|
|
|
120
120
|
All options are passed to `init()` or via `data-analytics-config` on the script tag.
|
|
121
121
|
|
|
122
|
-
| Option | Type | Default | Description
|
|
123
|
-
| ----------------- | --------- | --------------- |
|
|
124
|
-
| `endpoint` | `string` | env var | URL to send analytics events to
|
|
125
|
-
| `insightsId` | `string` | from script tag | Your Unisights project ID
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `trackClicks` | `boolean` | `true` | Auto-track click events |
|
|
132
|
-
| `trackScroll` | `boolean` | `true` | Auto-track scroll depth |
|
|
133
|
-
| `wasmPath` | `string` | inlined | Override wasm binary path (CDN usage) |
|
|
122
|
+
| Option | Type | Default | Description |
|
|
123
|
+
| ----------------- | --------- | --------------- | ------------------------------- |
|
|
124
|
+
| `endpoint` | `string` | env var | URL to send analytics events to |
|
|
125
|
+
| `insightsId` | `string` | from script tag | Your Unisights project ID |
|
|
126
|
+
| `debug` | `boolean` | `false` | Log events to the console |
|
|
127
|
+
| `flushIntervalMs` | `number` | `15000` | How often to flush events (ms) |
|
|
128
|
+
| `trackPageViews` | `boolean` | `true` | Auto-track page views |
|
|
129
|
+
| `trackClicks` | `boolean` | `true` | Auto-track click events |
|
|
130
|
+
| `trackScroll` | `boolean` | `true` | Auto-track scroll depth |
|
|
134
131
|
|
|
135
132
|
---
|
|
136
133
|
|
|
@@ -199,34 +196,6 @@ window.unisights?.log("event", { data: "value" });
|
|
|
199
196
|
|
|
200
197
|
---
|
|
201
198
|
|
|
202
|
-
## 🛠 Development
|
|
203
|
-
|
|
204
|
-
### Prerequisites
|
|
205
|
-
|
|
206
|
-
- Node.js >= 16
|
|
207
|
-
- Rust + Cargo
|
|
208
|
-
- wasm-pack (`cargo install wasm-pack`)
|
|
209
|
-
|
|
210
|
-
### Build
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# Install dependencies
|
|
214
|
-
pnpm install
|
|
215
|
-
|
|
216
|
-
# Build WASM core + JS bundle
|
|
217
|
-
pnpm build
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Local Dev Server
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
pnpm dev
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Serves `dist/` at `http://localhost:9005`.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
199
|
## 📜 License
|
|
231
200
|
|
|
232
201
|
MIT — see [LICENSE](./LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisights/analytics",
|
|
3
3
|
"description": "Unisights browser event tracking script",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"main": "dist/unisights.min.js",
|
|
6
6
|
"module": "dist/unisights.min.js",
|
|
7
7
|
"types": "dist/unisights.d.ts",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"cpx": "^1.5.0",
|
|
47
47
|
"dotenv": "^17.0.1",
|
|
48
48
|
"esbuild": "^0.23.0",
|
|
49
|
-
"live-server": "^1.2.2",
|
|
50
49
|
"typescript": "^5.5.0"
|
|
51
50
|
},
|
|
52
51
|
"files": [
|