@hanzo/event 0.3.34 → 0.3.36
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 +19 -7
- package/dist/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +18 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +18 -2
- package/dist/react.mjs.map +1 -1
- package/package.json +10 -10
- package/src/anon.test.ts +1 -1
- package/src/org.test.ts +16 -0
- package/src/org.ts +17 -1
- package/src/version.ts +1 -1
- package/LICENSE.md +0 -21
package/README.md
CHANGED
|
@@ -30,21 +30,33 @@ starve the other:
|
|
|
30
30
|
### No bundler? Use the hosted tag
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<script defer src="https://api.hanzo.ai/v1/event.js" data-key="pk-…"></script>
|
|
33
|
+
<script defer src="https://api.hanzo.ai/v1/event/tag.js" data-key="pk-…"></script>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
That one line is the whole install, and it is the same line for a published site,
|
|
37
37
|
hanzo.team and a customer's own page. The tag is served by the door that eats the
|
|
38
38
|
events, so a caller allowlists ONE host and the tag can never drift from the wire
|
|
39
|
-
it posts to
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
it posts to — `.js` is part of a segment rather than a child of one, so the tag
|
|
40
|
+
sits UNDER `/v1/event` rather than beside it, and the old sibling `/v1/event.js`
|
|
41
|
+
404s.
|
|
42
|
+
|
|
43
|
+
It autocaptures pageviews — the first one and every SPA navigation, since
|
|
44
|
+
`history.pushState` fires no event of its own — plus uncaught errors and rejected
|
|
45
|
+
promises. Anything a page means on purpose goes through `window.hanzo`
|
|
46
|
+
(`track`, `identify`, `page`, `error`, `flush`). It also carries the site's tag
|
|
47
|
+
config from `/v1/projects/tags`, so a pixel is configured on the project rather
|
|
48
|
+
than pasted into the page.
|
|
49
|
+
|
|
50
|
+
> A bundled app should NOT add this tag. Both clients post pageviews to the same
|
|
51
|
+
> door, so a page running `@hanzo/event` and the tag counts every pageview twice.
|
|
52
|
+
> One surface, one client.
|
|
43
53
|
|
|
44
54
|
> **`data-key` is a publishable `pk-`, and without one the tag is INERT.** A write
|
|
45
55
|
> the door cannot attribute is refused (`401 ingest_key_required`) silently, so a
|
|
46
|
-
> keyless tag measures fine in the browser and files nothing.
|
|
47
|
-
> `POST /v1/
|
|
56
|
+
> keyless tag measures fine in the browser and files nothing. A project mints one
|
|
57
|
+
> with itself: `POST /v1/projects`. A key that names no project is refused
|
|
58
|
+
> `403 ingest_key_unknown` — the door fails closed rather than filing a write it
|
|
59
|
+
> cannot attribute.
|
|
48
60
|
|
|
49
61
|
This package is the client for a surface that **builds**. There is no second
|
|
50
62
|
script-tag distribution here: one wire, one door, one tag.
|
package/dist/index.cjs
CHANGED
|
@@ -93,7 +93,23 @@ function dsnForProduct(product, key) {
|
|
|
93
93
|
|
|
94
94
|
// src/org.ts
|
|
95
95
|
var ORG_DOMAIN = Object.freeze({
|
|
96
|
-
|
|
96
|
+
// A brand's domains are not a pattern — `hanzoskills.com` is Hanzo's and does
|
|
97
|
+
// not end in `hanzo.ai`, while `hanzo.works` is a registrable domain of its own
|
|
98
|
+
// rather than a subdomain of anything here. Each is stated because each is a
|
|
99
|
+
// separate fact, which is the whole reason this is a table.
|
|
100
|
+
hanzo: Object.freeze([
|
|
101
|
+
"hanzo.ai",
|
|
102
|
+
"hanzo.app",
|
|
103
|
+
"hanzo.bot",
|
|
104
|
+
"hanzo.chat",
|
|
105
|
+
"hanzo.codes",
|
|
106
|
+
"hanzo.id",
|
|
107
|
+
"hanzo.sh",
|
|
108
|
+
"hanzo.team",
|
|
109
|
+
"hanzo.ventures",
|
|
110
|
+
"hanzo.works",
|
|
111
|
+
"hanzoskills.com"
|
|
112
|
+
]),
|
|
97
113
|
lux: Object.freeze([
|
|
98
114
|
"lux.network",
|
|
99
115
|
"lux.exchange",
|
|
@@ -376,7 +392,7 @@ function uuidv7Time(id) {
|
|
|
376
392
|
}
|
|
377
393
|
|
|
378
394
|
// src/version.ts
|
|
379
|
-
var VERSION = "0.3.
|
|
395
|
+
var VERSION = "0.3.36";
|
|
380
396
|
|
|
381
397
|
// src/sentry.ts
|
|
382
398
|
var MAX_FRAMES = 50;
|