@hanzo/event 0.3.31 → 0.3.33
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 +17 -19
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +14 -14
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +14 -14
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +14 -14
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -2
- package/src/anon.d.ts +1 -1
- package/src/anon.js +18 -18
- package/src/anon.test.ts +17 -38
- package/src/stack.ts +144 -0
- package/src/storage.test.ts +2 -2
- package/src/storage.ts +1 -1
- package/src/uid.ts +1 -1
- package/src/version.ts +1 -1
- package/hz.js +0 -553
- package/src/hz.test.ts +0 -376
package/README.md
CHANGED
|
@@ -27,29 +27,27 @@ starve the other:
|
|
|
27
27
|
> plane is **inert**: nothing is sent, nothing throws, analytics is unaffected.
|
|
28
28
|
> Assert `client.errorPlaneEnabled` if you want to know which you have.
|
|
29
29
|
|
|
30
|
-
### No bundler? Use the
|
|
30
|
+
### No bundler? Use the hosted tag
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<script
|
|
34
|
-
data-product="hanzo.ai"
|
|
35
|
-
data-ingest-key="pk-…"
|
|
36
|
-
data-capture="1"></script>
|
|
33
|
+
<script defer src="https://api.hanzo.ai/v1/event.js" data-key="pk-…"></script>
|
|
37
34
|
```
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
That one line is the whole install, and it is the same line for a published site,
|
|
37
|
+
hanzo.team and a customer's own page. The tag is served by the door that eats the
|
|
38
|
+
events, so a caller allowlists ONE host and the tag can never drift from the wire
|
|
39
|
+
it posts to. It adds DOM **autocapture** — `$click` (with an element locator),
|
|
40
|
+
`$outbound`, `$scroll`, `$form`, `$vitals` — which a bundled app does not need and
|
|
41
|
+
a plain page cannot get, and it carries the site's tag config from `/v1/tags`, so a
|
|
42
|
+
pixel is configured on the project rather than pasted into the page.
|
|
43
|
+
|
|
44
|
+
> **`data-key` is a publishable `pk-`, and without one the tag is INERT.** A write
|
|
45
|
+
> the door cannot attribute is refused (`401 ingest_key_required`) silently, so a
|
|
46
|
+
> keyless tag measures fine in the browser and files nothing. Mint one with
|
|
47
|
+
> `POST /v1/keys {"type":"publishable"}`.
|
|
48
|
+
|
|
49
|
+
This package is the client for a surface that **builds**. There is no second
|
|
50
|
+
script-tag distribution here: one wire, one door, one tag.
|
|
53
51
|
|
|
54
52
|
It honours the same consent sources the bundled stack does: an explicit stored
|
|
55
53
|
choice (`hz_consent`, the key a Hanzo consent banner writes) outranks the browser
|
package/dist/index.cjs
CHANGED
|
@@ -319,7 +319,7 @@ function uuidv7Time(id) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
// src/version.ts
|
|
322
|
-
var VERSION = "0.3.
|
|
322
|
+
var VERSION = "0.3.33";
|
|
323
323
|
|
|
324
324
|
// src/sentry.ts
|
|
325
325
|
var MAX_FRAMES = 50;
|
|
@@ -1110,26 +1110,26 @@ var COHORTS = {
|
|
|
1110
1110
|
channel: { field: "channel", label: "Acquisition channel" },
|
|
1111
1111
|
refCode: { field: "ref_code", label: "Referral code" }
|
|
1112
1112
|
};
|
|
1113
|
-
/*! anon.js — THE anonymous-identity chain. ONE implementation,
|
|
1113
|
+
/*! anon.js — THE anonymous-identity chain. ONE implementation, two distributions.
|
|
1114
1114
|
*
|
|
1115
1115
|
* One browser is ONE person on every Hanzo surface, whichever client a page
|
|
1116
|
-
* happens to have loaded. There were three implementations writing TWO keys —
|
|
1117
|
-
* `hz_anon_id`
|
|
1118
|
-
*
|
|
1116
|
+
* happens to have loaded. There were once three implementations writing TWO keys —
|
|
1117
|
+
* `hz_anon_id` and `hz_id` — so the same visitor was several people depending on
|
|
1118
|
+
* which snippet the surface shipped.
|
|
1119
1119
|
*
|
|
1120
|
-
* The
|
|
1120
|
+
* The two call sites:
|
|
1121
1121
|
* 1. src/storage.ts — the bundled npm client; IMPORTS this file.
|
|
1122
|
-
* 2.
|
|
1123
|
-
* 3. hanzoai/cloud apps/analytics/tag.js — the tag the door hosts at
|
|
1122
|
+
* 2. hanzoai/cloud apps/analytics/tag.js — the tag the door hosts at
|
|
1124
1123
|
* /v1/event.js; vendors this file and its tag.go serves the marked region
|
|
1125
1124
|
* with the tag as one asset, so the door holds no second copy either.
|
|
1126
1125
|
*
|
|
1127
|
-
* (2)
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
1126
|
+
* (2) has no bundler and cannot import anything, which is why the chain lives in a
|
|
1127
|
+
* file that is plain ES5 rather than in a .ts: the region between the BEGIN and END
|
|
1128
|
+
* markers is COPIED VERBATIM. Keep it ES5, dependency-free, `hz`-prefixed (it is
|
|
1129
|
+
* spliced into other people's scopes) and unformatted — a reformat here is a diff
|
|
1130
|
+
* against the vendored copy. After editing, resync the door:
|
|
1131
|
+
*
|
|
1132
|
+
* curl -fsSL https://unpkg.com/@hanzo/event/src/anon.js -o apps/analytics/anon.js
|
|
1133
1133
|
*/
|
|
1134
1134
|
|
|
1135
1135
|
Object.defineProperty(exports, "EVENTS", {
|