Files

33 KiB
Raw Permalink Blame History

@hanzo/event

0.3.69

Patch Changes

  • release reads process.env.NEXT_PUBLIC_HANZO_RELEASE by its literal name, so a bundler inlines it (the dynamic lookup never did in a browser bundle).

0.3.68

Patch Changes

  • Every event carries hostname, a templated route (ids, UUIDs and numeric segments become [id]; the query is never part of it), release, device_class and outcome. release is config.release or NEXT_PUBLIC_HANZO_RELEASE.
  • /auth/callback is no longer counted as a view. It reports one auth_callback ops event with latency_ms and outcome (success | error), and no query string; no other event is sent from that page but errors.

0.3.64

Patch Changes

  • capture(event, properties, fields) takes a location (url, path) beside the commerce fields, for an event about a page the visitor has already left: @hanzo/observe's $pageleave is noticed after the router moved and is filed under the page it measured. The location is scrubbed like every other.

0.3.63

Patch Changes

  • A choice is stored beside the rule it was made under (hz_consent_rule). eu counts only a choice made under eu, or under policy version 2: an opt-out made under us_privacy or global is no eu yes.
  • The policy floor gates grants, never opt-outs. A choice below the floor keeps what it refused and loses what it allowed: in eu the visitor is asked again, elsewhere the default stands for it. A choice that allowed nothing is never asked again.
  • Global Privacy Control or Do Not Track loads no platform in any region, Google Analytics included, and reads and saves as a refusal of all three. Consent Mode ADVANCED stays in eu for every other visitor.
  • consentSheet(open) says the consent sheet is open; a withdrawal that needs the page reloaded waits for it to close and then reloads once. A switch turned off and on before it closes reloads nothing.

0.3.62

Patch Changes

  • The rule is the visitor's region, decided by cloud per request and served with the tag config (consent.mode): eu (EU, EEA, UK, Switzerland, and any visitor cloud cannot place), us_privacy (a US state with a privacy law, or a US visitor with no attested state) or global. consentPolicy() answers { mode, refused, version, region } at once: cloud's answer, the one it last served this tab (sessionStorage), or eu.
  • eu: Google Analytics loads for everyone under Consent Mode v2 with all four flags denied and wait_for_update: 500 (cookieless pings), upgraded on a choice; Meta is init'ed after fbq('consent','revoke'), and fbevents is fetched, consent granted and the PageView sent only under Marketing; every other platform waits for Marketing. asks() is true here alone, before a choice.
  • us_privacy and global: Google Analytics and Meta (and every connected platform) run at once under Consent Mode granted. Ads saved off is the sale-or-sharing opt-out, exactly fbq('dataProcessingOptions',['LDU'],0,0) and gtag('consent','update',{ad_storage:'denied',ad_user_data:'denied',ad_personalization:'denied'}); any category saved off is an opt-out. notice() records the global notice closed (hz_consent_notice), noticed() reads it; it grants nothing.
  • Global Privacy Control or Do Not Track sets refused everywhere: in eu it refuses all three, elsewhere it is the opt-out (Ads off) and Google Analytics and Meta keep running.
  • Policy version 3 with floor 2: a choice made under version 2 still counts. Withdrawing Ads forgets Google's ad cookies (_gcl_*, _gac_*); Marketing the ad platforms' ids and the ad click; Analytics Google Analytics' cookies.
  • Google gets each change through Consent Mode and Meta through consent and Limited Data Use, with no reload; only a withdrawn library that cannot be told (Google Analytics outside eu, the other ad platforms) reloads the page. A GA4 event is addressed to its own measurement id (send_to).
  • region() and the Region type are gone; the rule is consentPolicy().mode (type Mode).

0.3.61

Patch Changes

  • The stream is first-party analytics and runs for every visitor: page views, events, identifies, groups and errors go under the anonymous id, the session and the visit's attribution, whatever the visitor chose and under Global Privacy Control or Do Not Track alike. Nothing is held for Accept, and there is no stranger's error.
  • Consent governs the third parties alone: Google Analytics (analytics), the Meta pixel (marketing) and ad personalization (ads), loaded by startTags and forwarded by cloud. Each event states the grants it was sent under; a grant withdrawn while an event waits is taken off it before it goes, and the event still goes.
  • Withdrawing a category forgets only what its third party kept (Google Analytics' cookies and hz_cid; the ad click and the ad platforms' browser ids). The anonymous id, session, touches, cohort and hz_internal are the stream's and stay.
  • enabled is not a consent switch: it turns the client off entirely. A site no longer passes enabled: consent.analytics to AnalyticsProvider.

0.3.60

Patch Changes

  • Every Meta pixel a site reports to (one per brand): fbevents loads once, Limited Data Use is stated once before the first init, each pixel is init'ed, and ONE PageView goes, since fbq('track') reaches every pixel on the page. Each event fires to Meta once, under one eventID.
  • Withdrawing Marketing also forgets the Pinterest and Reddit pixels' first-party cookies (_pin_unauth, _epik, _derived_epik, _rdt_uuid, _rdt_cid).
  • Withdrawal matches cookies by exact name or a platform's numbered form (_gat and _gat_<tracker>, _ga_<container>, _uetsid / _uetvid, ttcsid and ttcsid_<pixel>), so a site's own _gateway_session, _uetoken or ttcsid_app is never deleted.
  • A withdrawn cookie is deleted on the host and on every domain above it, so one a library set on .example.co.uk goes too.

0.3.58

Patch Changes

  • Every visitor opts in, wherever they are. A visitor with no stored choice has allowed nothing: the time-zone guess is gone, and a mode or defaults cloud serves presumes nothing. Global Privacy Control and Do Not Track refuse all three categories, whatever is stored, and the banner does not ask.
  • In a browser the client sends no pageview, event, identify or group, and writes no id, session, first touch or cohort, until the visitor allows Analytics. An error still goes, as a stranger: an id for that page alone, no session, no attribution. On Accept the client adopts the link it arrived with, stores the first and last touch, and sends the identify and the view in hand. link() carries nothing before consent.
  • Every browser event states the consent it was sent under.
  • lastUtm beside utm: the campaign of the most recent visit that arrived with one, kept 90 days (hz_last_touch).
  • The policy cloud served lives on the page (Symbol.for('hanzo.event.consent')), so @hanzo/event and @hanzo/event/react read the same version. The version in force before cloud answers is the one this client was built under, CONSENT_VERSION = 2, so a choice made under the opt-out policy never counts. A refusal cloud saw on the request (GPC or DNT header) counts as one.
  • Withdrawing a category forgets what it kept: Analytics the anonymous id, the session, the first and last touch, the cohort and _ga*; Marketing hz_touch, _fbp, _fbc and _gcl_*.
  • The ad click and the browser ids are set on a brand's own registrable domain (ORG_DOMAIN) and stay on the host everywhere else, including every app on hanzo.app.
  • A stranger's error names the page without its query. The site's team is marked (hz_internal) only under Analytics.
  • The client registry is Symbol.for('hanzo.event.clients.optin'): a client a pre-opt-in copy left on the page is never handed to this one.
  • The choice is kept under __Host-hz_consent / __Host-hz_consent_v on a secure page: host-only, so no sibling subdomain (another tenant's app, a shared page) can set or shadow it, and each host asks for itself. A plain-http page keeps the bare names on its host.
  • A policy older than the client's own (2) never revives a choice. GA4 waits for Analytics; Marketing alone loads only the ad platforms. ?hz_internal=1 keeps its mark only under Analytics. Withdrawing Analytics also forgets _gid, _gat* and hz_internal; withdrawing Marketing _ttp and li_fat_id. A stranger's error names its pages without their queries in the stack and frames too.
  • A withdrawal stops what already runs. When a choice withdraws what a loaded platform library was loaded under, Google hears the denied state and Meta a revoke at once, and the page reloads: a library that has run cannot be unloaded. An event goes out only under a choice that still covers the one it was stamped with, so nothing queued under a withdrawn grant is sent, whichever tab withdrew it; a page shown again reads the choice afresh. Withdrawing Personalized ads alone puts Meta under Limited Data Use. The client forgets the visitor it held, so a later yes is a new visitor. A browser that starts sending GPC or DNT over a stored yes withdraws it the same way. Withdrawing also forgets the legacy hz_anon_id / hz_id cookies, _gac_*, _uet*, X's _twclid, TikTok's _tt_enable_cookie / ttcsid* and li_giant. declined() says whether the browser or cloud refused.
  • A stranger's error names no query in its message or stack — any scheme, or a bare path, a : in the query included — and carries none of the caller's properties.
  • @hanzo/ui requires @hanzo/event (no longer an optional peer).

0.3.52

Patch Changes

  • useConsent re-renders when cloud's rule arrives, so a stream started silent for an opt-in visitor and a banner drawn from the time-zone guess both follow the served region.

0.3.51

Patch Changes

  • The region comes from cloud: startTags reads the consent rule GET /v1/project/tags serves for this visitor (opt-in or opt-out, what is on before a choice, GPC) and serveConsent applies it; the time zone is only the answer until cloud replies. A choice is stored with the policy version it was made under and asked again when the version changes. notices() and POLICY_EVENT let a banner draw the opt-out notice and redraw when the rule arrives.
  • Global Privacy Control turns marketing and ads off and leaves analytics as the region says.
  • Each site files its events under its own project: SITE_KEY (now in org, with siteKey) names hanzo.agency, console, admin and bot beside the rest, and keyFor answers a site's own key before its org's.

0.3.50

Patch Changes

  • tagsReady(limit) resolves once the tags the visitor's choice loads have taken the page view, for a page about to leave.
  • A page view carries screen and language.
  • The hanzo org's default ingest key is the hanzo.ai project's, so every first-party site's events reach project 1. SITE_KEY names hanzo.chat, hanzo.id, hanzo.industries, hanzo.market and hanzo.network, each with its own GA4 stream.

0.3.49

Patch Changes

  • An error is ONE type:'error' event on /v1/event with error {type, message, frames, stack, handled}, level, release, environment, site and product. The $exception event, the Sentry envelope, the DSN and its config are gone.
  • ORG_DOMAIN.hanzo names hanzo.agency, hanzo.industries, hanzo.market and hanzo.network.

0.3.48

Patch Changes

  • useConsent() (@hanzo/event/react) is the visitor's consent, live. Pass enabled: useConsent().analytics to the provider and a stream that started silent for an EU visitor starts on Accept, with no reload.

0.3.47

Patch Changes

  • commerceItem() names a plan as GA4's item (item_id, item_category individual or team, item_variant monthly or annual, price, quantity), the one shape every commerce event carries.

0.3.46

Patch Changes

  • track(stream, name, params, 'tags') fires the browser pixels only, and a params.event_id is used as the moment's id: a paid order the server states on our stream keeps one id everywhere.

0.3.45

Patch Changes

  • startTags() finds a site's tag set by host: SITE_KEY names each Hanzo site's project key.

0.3.44

Patch Changes

  • One tag manager for every Hanzo surface. startTags() fetches the site's tag set from cloud (GET /v1/project/tags, non-secret ids) and loads Google (GA4 and Google Ads), Meta, LinkedIn, X and TikTok, each only after consent and none from a site's own code. track(stream, name, params) mints one event_id, fires every running pixel under the names the platform table in @hanzo/events gives, and records the moment on our stream with the consent, the click ids and the list of pixels reached (tags), which is what lets cloud send GA4 only what gtag did not and dedupe Meta, TikTok and GA4 purchases by id.
  • Consent by region. readConsent, saveConsent, acceptAll, rejectAll, asks, region: opt-in outside the US (nothing until accepted), opt-out in it, Global Privacy Control and Do Not Track always turn marketing off. Google Consent Mode v2 is set denied before gtag.js is fetched and updated on every choice; a choice that allows more loads the rest with no reload.
  • Click ids. captureClick keeps gclid, gbraid, wbraid, fbclid (and _fbc), li_fat_id, twclid and ttclid for 90 days with consent; touch is what an event carries for cloud to match it on.
  • Test-mode orders (test: true) are debug traffic in the browser and carry no amount. PLATFORMS and namesOn are re-exported from @hanzo/events 0.3.1.

0.3.43

Patch Changes

  • A visitor crossing the sign-in redirect became a new person on every host. hanzo.ai, hanzo.id and hanzo.app share no cookie, so zero anonymous ids matched across them and the journey through IAM could not be read. Analytics.link(url) appends hz_aid, hz_sid and hz_ft (anonymous id, session, first touch) when the destination is a host in ORG_DOMAIN, and only then. init() adopts them before the first pageview, persists the id in the first-party cookie, and strips them from the address bar. Analytics.authorize(url) does the same for the OAuth redirect to IAM and flushes the queue, since the page is about to unload. Ids that are not UUIDs are refused. linkUrl, readLink, stripLink are exported.

0.3.42

Patch Changes

  • No stamped location carries a fragment. Every event's url, path and referrer now drop everything from the first # before they are scrubbed. A browser never sends a fragment to a server, and apps keep device-only state there — hanzo.ai's /chat/shared#<secret> share links among them — so the client sends none either.
  • A lone 43-character base64url run that mixes upper and lower case is redacted, also where it follows a percent-escape such as the %23 of an encoded #. That is the shape of a 256-bit secret written unpadded, which no other secret pattern matched.

0.3.36

Patch Changes

  • Four live Hanzo sites were absent from the domain table, so they resolved no key and reported nothing. hanzo.works, hanzo.codes, hanzoskills.com and hanzo.ventures are all served by universe and all answered 200 while filing zero events; hanzo.team was missing too. This is the exact failure 0.3.34 described — "a site added tomorrow reports nothing until somebody remembers to paste one in" — arriving as four sites nobody pasted one into. hanzo.ventures is the clearest: it mounts AnalyticsProvider with NEXT_PUBLIC_PUBLISHABLE_KEY || '' and its own comment admits the key is empty. It now resolves Hanzo's key from its hostname and needs no edit of its own.

    A brand's domains are not a pattern — hanzoskills.com does not end in hanzo.ai, and hanzo.works is a registrable domain rather than a subdomain of one — so each is a separate fact and the test pins all five against the hosts universe actually serves.

0.3.35

Patch Changes

  • The hosted tag's address here was one the ingest endpoint does not answer. 0.3.33 removed hz.js and pointed readers at api.hanzo.ai/v1/event.js. Hours later the ingest endpoint took the app's name, and the tag moved UNDER it: .js is part of a segment rather than a child of one, so a tag beside /v1/event could not be routed by the prefix that serves it. The address is GET /v1/event/tag.js, there is no alias behind the old one, and this README was sending people to a 404.

  • It also described autocapture the tag does not do. The listed $click, $outbound, $scroll, $form and $vitals are the BUNDLED capture engine's. The hosted tag captures pageviews (initial and every pushState navigation), uncaught errors and rejected promises; everything deliberate goes through window.hanzo. A page reading the old paragraph would have shipped a tag expecting a heatmap and got none.

  • Its config endpoint is /v1/projects/tags, not /v1/tags — the config follows the project store it reads. A key is minted with POST /v1/projects, not a keys endpoint of its own, and one that names no project is refused 403.

  • Says plainly that a surface runs the tag OR this client, never both: they post pageviews to the same endpoint, so a page carrying both counts every one twice.

0.3.34

Patch Changes

  • A surface no longer configures its own key — the host resolves it. A domain belongs to exactly one brand, so a key stated per site restates something the page already knows, and the fleet held one copy per surface of a value with a single source. org.ts answers orgOf(location.hostname) and hands back that org's publishable key, as a THIRD step after an explicit ingestKey and the KMS-sourced NEXT_PUBLIC_PUBLISHABLE_KEY — so it never overrides what a build already resolved, it only replaces going dark.

    This is the defect hanzo.id already fixed for the identity hosts, in its other form. There, ONE build-time key was inlined for every brand, so Lux's, Zoo's, Osage's and Pars' visitors were all filed in HANZO's project. On the marketing sites each surface commits its OWN literal instead, so a site added tomorrow reports nothing until somebody pastes one in. Both are the same mistake: a key treated as a property of the BUILD rather than of the brand being served.

    keyFor(host, keyring?) takes the keyring as a parameter precisely so the identity runtime — which receives one from /config.json because a single image serves every brand — resolves through this function rather than a second copy.

    An unrecognised host resolves to UNDEFINED and reports nothing. There is no fallback to Hanzo: osage, pars and bootnode have no project of their own, and filing them under a brand that is not theirs is silent, reads as working, and only surfaces later in someone else's warehouse.

0.3.15

Patch Changes

  • One anonymous identity chain, in one file, for all three distributions. 0.3.14 moved anonId() onto a shared cookie, but only in the bundled client: hz.js still minted into hz_id — a KEY OF ITS OWN — and the tag hosted at /v1/event.js had a third implementation of the same idea. A page carrying two of them counted one visitor as two people, and which snippet a surface happened to load decided who the visitor was. The chain now lives in src/anon.js and nothing else implements it: src/storage.ts imports it, hz.js inlines the marked region verbatim (src/anon.test.ts fails on a byte of drift), and hanzoai/cloud vendors the same file and serves that region with its tag as one asset.
  • hz_id is adopted, not orphaned. Resolution is cookie, else localStorage hz_anon_id, else localStorage hz_id, else in-memory, else mint — every id already in a browser is taken over, and only a browser holding none is given a new one. Every visitor who has ever loaded hz.js keeps their history.
  • hz.js also drops its own restated UUIDv7 minter: the chain carries the one minter, so the version nibble the event plane's session rollups admit can no longer diverge between distributions. sessionId() is unchanged.

0.3.14

Patch Changes

  • One anonymous visitor is now ONE person across every *.hanzo.ai surface. The anonymous id lived in localStorage, which is ORIGIN-scoped, so docs, cloud, console, studio, pay and www each minted their own id for the same browser: a single marketing → docs → signup → checkout journey arrived as several strangers, and 463 anonymous identities carried 545 events in a week — about 1.2 events each, which is a funnel that cannot be read. anonId() now keeps the id in a first-party cookie on the registrable domain (Domain=hanzo.ai; Path=/; SameSite=Lax; Secure, two years, refreshed on read), which every subdomain shares.
  • The migration is additive — no returning visitor is reset. Resolution is cookie, else the hz_anon_id this package has always written in localStorage — ADOPTED into the cookie, never minted over, because minting there would hand every returning visitor a new identity and detach them from their own history — else mint. localStorage keeps being written, so a rollback finds everyone where it left them.
  • Degrades the way it always did: SSR and prerender still return undefined rather than minting a server-side id; cookies refused falls back to localStorage; both refused holds one id in memory for the page load instead of letting every event mint its own. Domain and Secure are omitted off hanzo.ai (localhost, previews), where either attribute would make the browser drop the cookie outright. sessionId() is deliberately unchanged — a session stays origin-local.

0.3.13

Patch Changes

  • A credential is redacted by the parameter name it is filed under, not by its shape. Every SECRET_PATTERNS entry recognised a secret by what it looks like — a JWT's three dots, sk-, AKIA, ghp_ — but an OAuth code, a state, a password-reset nonce and an invite token are opaque random strings indistinguishable from a page id, so none matched and all survived. The client stamps url on EVERY event, so one visit to /callback?code=&state= put a live, still-redeemable authorization code on the wire once per event. Ordinary params (plan, utm_source, page) are untouched.

0.3.12

Patch Changes

  • hz.js can finally present a key, so a keyed static surface stops filing nothing. Through 0.3.11 the script tag sent no credential on either transport — no Authorization, no ?ingest_key= — so every write from an origin other than the endpoint's own was unattributed, and the edge refuses an unattributable write (401 ingest_key_required). Nothing here reads the response, so the tag measured fine in the browser and the surface was simply absent from the warehouse. data-ingest-key="pk-…" now rides Authorization: Bearer on fetch and ?ingest_key= on the headerless unload beacon — the same pair core.ts uses, so the endpoint cannot tell the distributions apart.
  • The tag honours the consent the rest of the stack honours. It read Do Not Track only. It now also obeys Global Privacy Control (the signal CPRA actually requires) and the hz_consent stored choice a Hanzo consent banner writes — which outranks the browser signal in BOTH directions, because that is what explicit means.
  • libraryVersion is pinned to the package version. It had drifted to 0.3.9 against a published 0.3.11, dating every static-site row in the warehouse to a release three patches old — including the ones that changed what the tag sends. A test now fails on any drift, matching the one that already pins src/version.ts.
  • The hz.js suite runs again. Node ≥ 21 ships a real navigator whose descriptor is an accessor with no setter, so the harness's plain assignment threw and every test in the file failed — the one shipped file with no bundler and no import-time type checking had no executed coverage at all. Globals are defined, not assigned, and the suite now also asserts what reaches the wire: transport, URL and headers, not just the batch.

0.3.7

Patch Changes

  • hz.js moved here — the tag is a distribution of this client, not a second client. It lived in hanzoai/analytics and posted a bare JSON array of {site, ts, type, path, …} to analytics.hanzo.ai/v1/event: a second protocol behind an identical path spelling, served by a second collector with its own database. Measured, POST api.hanzo.ai/v1/event {"batch":[]} answered 200 and POST analytics.hanzo.ai/v1/event [] answered 204, so a client pointed at the wrong host failed silently. The tag now emits the canonical WireEvent shape as { batch: [ … ] } to POST {host}/v1/event, defaulting to api.hanzo.ai; the Next.js endpoint and the collector it fed are deleted. One wire, one endpoint, one home.
  • DOM autocapture reaches the one stream. $click (with a compact, PII-light element locator), $outbound, $scroll depth, $form and $vitals — what a bundled app does not need and a plain page cannot get. data-product names the surface, data-host overrides the API host, data-capture="0" turns autocapture off, DNT is respected, and optional data-ga / data-fb fan out unchanged.

0.3.3

Patch Changes

  • A hostile thrown object no longer costs the report. name, message and stack are ordinary getters, and a thrown object is free to define them to throw — the thrown value is the least trustworthy input this library handles. Each is now read defensively, and String() coercion is guarded too, so normalizeError is total: it returns a usable record for ANY input. Both planes share that one normalizer; previously each rolled its own reader, so a throwing stack getter silently lost the crash report on both.
  • Bounded the email rule. Like the creds-in-URL rule fixed in 0.3.2, the unbounded local-part backtracked across a long run of legal characters that never reached an @. Capped to the RFC 5321 maxima; no real address is excluded.

0.3.2

Patch Changes

  • Errors actually reach Sentry now. Every captured exception is framed as a real Sentry envelope and POSTed to /v1/sentry/{projectId}/envelope/, authenticated by a DSN key on ?sentry_key=. Set dsn (or NEXT_PUBLIC_HANZO_EVENT_DSN); with no DSN the error plane is inert (fail-safe) and the event stream is unaffected. This closes a total outage of the fleet's error telemetry. Versions ≤0.3.1 documented errors as "lensed server-side into … error tracking (sentry)". No such fan-out exists — /v1/event writes a type:'error' row to the event warehouse and stops. Every property believed the claim, nobody set a DSN, and zero errors reached the Sentry dashboard. The claim has been corrected everywhere it shipped (description, README, src).

  • The two planes are independent, in both directions. captureError reports to Sentry FIRST, and each plane has its own try. properties is arbitrary caller data — a DOM node, a React synthetic event or an axios error is circular — and previously anything that threw while serializing the event stream killed the crash report before it was sent, and dropped the events already buffered too. Batch serialization now salvages per event.

  • Bounded the scrubber against denial of service. The creds-in-URL pattern backtracked quadratically on colon-rich text: 32KB took 4.9s and 128KB never finished, freezing the main thread from inside captureError (throw new Error(await res.text()) on an HTML error page is the one-line trigger). Input is capped at 8KB and the pattern bounded; 128KB now completes in ~1ms. Stack parsing is bounded the same way.

  • Card redaction is Luhn-gated. The bare 13–19 digit rule was a false-positive cannon that ate every millisecond epoch timestamp (request 1753468800000 timed out → request [redacted]timed out), wrecking the readability of the messages this client exists to deliver. Gating on Luhn removes the false positives without adding a false negative — a real card always passes.

  • Transport outcome is visible under debug. A non-OK or failed ingest was swallowed, which is the same silent-failure shape as the incident above; note the ingest CORS allowlist rejects non-production origins, so local dev never reports.

  • Client-side secret + PII scrubbing (a faithful port of the server's scrub.go) now runs before any error leaves the device.

  • FUNNELS — the one funnel registry. Funnels are now data (funnels.ts): an ordered list of steps per product journey, each step naming an EVENTS value. A test fails the build if a funnel references an event no constant defines, so the spec cannot drift from the vocabulary. GOALS no longer restate their steps — they carry a funnelId and derive funnel from the registry. Shipped: signup, apiActivation, upgrade, appShip, chatEngage, siteToChat.

  • Fixed the Signup goal. Its funnel required signup_verified, which no surface emits (it is IAM-internal) — the third step was always empty, so the goal reported 0% conversion. The funnel is now $pageview → signup_viewed → signup_submitted → signup_completed → first_action.

  • New events, each load-bearing in a shipped funnel: login_completed (a returning sign-in is not a signup), build_started (build INTENT, distinct from app_created), generation_completed / generation_failed (the outcome of anything a model produces, carrying durationMs), deploy_succeeded / deploy_failed (a live URL is its own event, never inferred), and model_switched (the strongest dissatisfaction signal a chat surface has).

  • PRODUCTS is now a closed set (site | app | chat | console | admin | cloud) — the values AnalyticsConfig.product may take, and what a funnel scopes by. Event names stay product-free: the surface is already on the wire.

  • A cross-origin funnel must declare join: 'aggregate'. Two origins mean two anonymousIds for a logged-out visitor, so a per-person conversion across them would be a lie; the type makes that explicit (see siteToChat).

  • VERSION had drifted to 0.3.0 while the package was 0.3.1, so libraryVersion on every event was wrong. It now tracks package.json.

  • Documented the whole thing in TAXONOMY.md — naming convention, required properties, identify/group semantics, the per-app funnels, and the exact emit sites in hanzo.ai / hanzo.app / hanzo.chat.

0.3.1

Patch Changes

  • Fixed the CommonJS build: under "type": "module" the CJS bundle emitted to dist/index.js was parsed as ESM, so require('@hanzo/event') threw ReferenceError: exports is not defined in ES module scope. CJS is now emitted as .cjs (ESM stays .mjs) and exports maps each condition to its own types, so both import and require resolve. No API change.

0.3.0

Minor Changes

  • Repointed the whole client onto the ONE canonical Hanzo Cloud ingestion endpoint: POST /v1/event with the batched { batch: [Event, …] } wire, replacing the deprecated /v1/analytics + /v1/tracker split (and the interim /v1/ingest publishable-key endpoint — publishable keys now authenticate directly on /v1/event). One endpoint, one wire, for cookie, bearer, and publishable-key auth alike.
  • Errors now reliably reach the error-tracking lens. The batched Event wire carries the type field, which Cloud folds to event_type='error'; the captured exception rides the top-level error field (Cloud lifts it into properties.$exception). window.onerror, unhandledrejection, and the React ErrorBoundary all funnel here.
  • The publishable key (ingestKey) rides Authorization: Bearer pk_… on fetch and ?ingest_key=pk_… on a headerless unload beacon, so public pages emit to all three lenses (web + product + error) anonymously.

0.2.0

Minor Changes

  • Renamed from @hanzo/capture to @hanzo/event — the ONE telemetry client. An error is just another event on the one stream, so error tracking now lives here too (subsumes @sentry): captureError()/captureException(), a React ErrorBoundary, and auto-capture of unhandled errors + promise rejections (opt-out via captureErrors: false). Added the error event kind and the Exception type. The server lenses the one stream into product analytics, web analytics, and error tracking (insights/analytics/sentry.hanzo.ai).

0.1.1

Patch Changes

  • #240 8b5164a Thanks @zeekay! - Add @hanzo/capture — the shared product-analytics capture client. Batched pageview/event/identify/group emit to Hanzo Cloud (/v1/analytics + /v1/tracker) with first-touch UTM/referrer/refCode attribution, beacon-on-unload, dual cookie/bearer auth, and the shared event + goal + cohort vocabulary (EVENTS, GOALS, COHORTS). Framework-agnostic core plus a @hanzo/capture/react provider and hooks.