@litemetrics/node 0.1.2 → 0.1.3
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 +16 -0
- package/dist/index.cjs +557 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +557 -65
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -87,6 +87,22 @@ await collector.track('site-id', 'Purchase', { amount: 99 }, { userId: 'user-123
|
|
|
87
87
|
await collector.identify('site-id', 'user-123', { plan: 'pro' });
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
## Identity Merging
|
|
91
|
+
|
|
92
|
+
Litemetrics automatically links anonymous visitors to identified users. After a
|
|
93
|
+
user is identified, subsequent events are merged across all linked visitor IDs.
|
|
94
|
+
`GET /api/users/:identifier` accepts either a `visitorId` or a `userId` and
|
|
95
|
+
returns a merged profile when available.
|
|
96
|
+
|
|
97
|
+
### Backfill (one-time)
|
|
98
|
+
|
|
99
|
+
If you already have identify events, run the backfill script once to populate
|
|
100
|
+
the identity map:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
bun packages/node/src/backfill-identity.ts --adapter clickhouse --url http://localhost:8123
|
|
104
|
+
```
|
|
105
|
+
|
|
90
106
|
## Metrics
|
|
91
107
|
|
|
92
108
|
| Metric | Description |
|