@hanzo/event 0.3.21 → 0.3.22
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/dist/index.cjs +44 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -51
- package/dist/index.d.ts +2 -51
- package/dist/index.mjs +4 -54
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +3 -6
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +1 -4
- package/dist/react.mjs.map +1 -1
- package/package.json +12 -9
- package/src/events.ts +21 -76
- package/LICENSE.md +0 -21
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/event",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Hanzo Event
|
|
3
|
+
"version": "0.3.22",
|
|
4
|
+
"description": "Hanzo Event \u2014 the ONE telemetry client. Emits pageview/event/identify/group to the Hanzo Cloud event stream (POST /v1/event), AND reports errors to Sentry as real Sentry envelopes \u2014 the error plane needs a DSN, without one nothing reaches Sentry. First-touch attribution, beacon-on-unload, auto error capture, client-side secret/PII scrubbing, a shared event + goal vocabulary. Subsumes @sentry.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
7
7
|
"access": "public",
|
|
@@ -37,6 +37,13 @@
|
|
|
37
37
|
"funnel",
|
|
38
38
|
"hanzo"
|
|
39
39
|
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup",
|
|
42
|
+
"dev": "tsup --watch",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"clean": "rm -rf dist"
|
|
46
|
+
},
|
|
40
47
|
"exports": {
|
|
41
48
|
".": {
|
|
42
49
|
"import": {
|
|
@@ -75,11 +82,7 @@
|
|
|
75
82
|
"typescript": "^5.9.3",
|
|
76
83
|
"vitest": "^4.1.0"
|
|
77
84
|
},
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"dev": "tsup --watch",
|
|
81
|
-
"test": "vitest run",
|
|
82
|
-
"typecheck": "tsc --noEmit",
|
|
83
|
-
"clean": "rm -rf dist"
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"@hanzo/events": "^0.2.0"
|
|
84
87
|
}
|
|
85
|
-
}
|
|
88
|
+
}
|
package/src/events.ts
CHANGED
|
@@ -1,76 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
LOGIN_COMPLETED: 'login_completed',
|
|
23
|
-
/** Activation: the first moment of real value. ONE event for every product —
|
|
24
|
-
* the product-specific moment is the `action` property (api_call, app_live,
|
|
25
|
-
* chat_reply), never a new event name. */
|
|
26
|
-
FIRST_ACTION: 'first_action',
|
|
27
|
-
|
|
28
|
-
// Waitlist + referral.
|
|
29
|
-
WAITLIST_JOINED: 'waitlist_joined',
|
|
30
|
-
WAITLIST_SHARED: 'waitlist_shared',
|
|
31
|
-
REFERRAL_USED: 'referral_used',
|
|
32
|
-
REFERRAL_CLAIMED: 'referral_claimed',
|
|
33
|
-
|
|
34
|
-
// Upgrade-intent + purchase.
|
|
35
|
-
PRICING_VIEWED: 'pricing_viewed',
|
|
36
|
-
PLAN_CLICKED: 'plan_clicked',
|
|
37
|
-
CHECKOUT_STARTED: 'checkout_started',
|
|
38
|
-
ORDER_COMPLETED: 'order_completed',
|
|
39
|
-
|
|
40
|
-
// Feature usage — generic + the common key surfaces across products.
|
|
41
|
-
FEATURE_USED: 'feature_used',
|
|
42
|
-
API_KEY_CREATED: 'api_key_created',
|
|
43
|
-
APP_CREATED: 'app_created',
|
|
44
|
-
PROJECT_CREATED: 'project_created',
|
|
45
|
-
AGENT_CREATED: 'agent_created',
|
|
46
|
-
CHAT_STARTED: 'chat_started',
|
|
47
|
-
CHAT_MESSAGE_SENT: 'chat_message_sent',
|
|
48
|
-
/** The user switched model/endpoint — the single strongest quality signal a
|
|
49
|
-
* chat surface emits (a switch usually follows a bad answer). */
|
|
50
|
-
MODEL_SWITCHED: 'model_switched',
|
|
51
|
-
TASK_STARTED: 'task_started',
|
|
52
|
-
TASK_COMPLETED: 'task_completed',
|
|
53
|
-
|
|
54
|
-
// Build → ship. `build_*` is a MODEL producing an artifact; `deploy_*` is that
|
|
55
|
-
// artifact going live. Intent (build_started) is never the same event as the
|
|
56
|
-
// artifact existing (app_created) — conflating them makes the funnel lie.
|
|
57
|
-
BUILD_STARTED: 'build_started',
|
|
58
|
-
/** A model finished producing an artifact (an app build, a chat reply, an agent
|
|
59
|
-
* run). Carries `durationMs` — the outcome event owns its own duration, so no
|
|
60
|
-
* paired start event is needed. */
|
|
61
|
-
GENERATION_COMPLETED: 'generation_completed',
|
|
62
|
-
GENERATION_FAILED: 'generation_failed',
|
|
63
|
-
DEPLOY_STARTED: 'deploy_started',
|
|
64
|
-
DEPLOY_SUCCEEDED: 'deploy_succeeded',
|
|
65
|
-
DEPLOY_FAILED: 'deploy_failed',
|
|
66
|
-
} as const
|
|
67
|
-
|
|
68
|
-
export type EventName = (typeof EVENTS)[keyof typeof EVENTS]
|
|
69
|
-
|
|
70
|
-
/** The reserved event name a pageview is stored under (server + read lens). */
|
|
71
|
-
export const PAGEVIEW = '$pageview'
|
|
72
|
-
|
|
73
|
-
/** The reserved name every captured exception is emitted under. Error Tracking
|
|
74
|
-
* reads exactly this name; an exception emitted under its own message instead
|
|
75
|
-
* makes every distinct message a permanent entry in the event taxonomy. */
|
|
76
|
-
export const EXCEPTION = '$exception'
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary, re-exported from where it is now defined.
|
|
3
|
+
*
|
|
4
|
+
* These names used to be declared here. They moved to @hanzo/events — the
|
|
5
|
+
* plural package is the catalog (many events, what each means, what each
|
|
6
|
+
* carries), this one is the client (one call sends one event). Splitting them
|
|
7
|
+
* that way is what lets the ingest door read the same catalog: the door is Go
|
|
8
|
+
* and cannot import TypeScript, so @hanzo/events also ships the data as JSON,
|
|
9
|
+
* and there is still exactly one definition.
|
|
10
|
+
*
|
|
11
|
+
* Nothing about the API moved. Every existing import keeps working, the names
|
|
12
|
+
* and their values are unchanged, and `pkgs/events/test/catalog.mjs` fails the
|
|
13
|
+
* build if a name and its meaning ever disagree.
|
|
14
|
+
*
|
|
15
|
+
* The naming convention lives with the names, in @hanzo/events and TAXONOMY.md:
|
|
16
|
+
* snake_case `<object>_<verb-past>`, a dimension is a PROPERTY and never part
|
|
17
|
+
* of the name, one name per user-visible moment shared by every surface.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export { EVENTS, PAGEVIEW, EXCEPTION } from '@hanzo/events'
|
|
21
|
+
export type { EventName } from '@hanzo/events'
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 hanzo
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|