@hanzo/event 0.3.30 → 0.3.32

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/hz.js CHANGED
@@ -11,7 +11,6 @@
11
11
  * data-product="hanzo.ai" // required: which surface this is
12
12
  * data-publishable-key="pk-…" // required off api.hanzo.ai's own origin
13
13
  * data-host="https://api.hanzo.ai" // optional: API host override
14
- * data-ga="G-XXXX" data-fb="123" // optional: also fan out to GA4 / Meta
15
14
  * data-capture="1"></script> // optional: autocapture off with "0"
16
15
  *
17
16
  * It adds what a bundled app does not need and a plain page cannot get: DOM
@@ -55,7 +54,7 @@
55
54
  }
56
55
 
57
56
  var LIB = 'hz.js'
58
- var VERSION = '0.3.30'
57
+ var VERSION = '0.3.32'
59
58
  var host = (s.getAttribute('data-host') || 'https://api.hanzo.ai').replace(/\/+$/, '')
60
59
  var product = s.getAttribute('data-product') || location.hostname
61
60
  var capture = s.getAttribute('data-capture') !== '0'
@@ -509,45 +508,4 @@ function hzAnonId() {
509
508
  },
510
509
  flush: flush,
511
510
  }
512
- var ga = s.getAttribute('data-ga'),
513
- fb = s.getAttribute('data-fb')
514
- function load(src) {
515
- var el = document.createElement('script')
516
- el.async = true
517
- el.src = src
518
- document.head.appendChild(el)
519
- }
520
- if (ga) {
521
- load('https://www.googletagmanager.com/gtag/js?id=' + ga)
522
- window.dataLayer = window.dataLayer || []
523
- window.gtag = function () { dataLayer.push(arguments) }
524
- gtag('js', new Date())
525
- gtag('config', ga)
526
- var _t = window.hanzo.track
527
- window.hanzo.track = function (n, p) {
528
- _t(n, p)
529
- try { gtag('event', n, p || {}) } catch (e) {}
530
- }
531
- }
532
- if (fb) {
533
- !(function (f) {
534
- if (f.fbq) return
535
- var n = (f.fbq = function () {
536
- n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments)
537
- })
538
- if (!f._fbq) f._fbq = n
539
- n.push = n
540
- n.loaded = !0
541
- n.version = '2.0'
542
- n.queue = []
543
- })(window)
544
- load('https://connect.facebook.net/en_US/fbevents.js')
545
- fbq('init', fb)
546
- fbq('track', 'PageView')
547
- var _u = window.hanzo.track
548
- window.hanzo.track = function (n, p) {
549
- _u(n, p)
550
- try { fbq('trackCustom', n, p || {}) } catch (e) {}
551
- }
552
- }
553
511
  })()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/event",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "Hanzo Event — 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 — 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/",
package/src/core.test.ts CHANGED
@@ -515,15 +515,6 @@ describe('Event error capture', () => {
515
515
  expect(p.$exception_fingerprint).not.toBe('forged')
516
516
  })
517
517
 
518
- it('captureException is an alias of captureError', () => {
519
- const a = mk()
520
- a.captureException(new Error('via alias'))
521
- const e = tx.all[0]
522
- expect(e.event).toBe('$exception')
523
- expect(e.type).toBe('event')
524
- expect(e.error?.message).toBe('via alias')
525
- })
526
-
527
518
  it('an error is still an event on the ONE stream — same /v1/event door + product', () => {
528
519
  const a = mk({ host: 'https://api.hanzo.ai' })
529
520
  a.captureError(new Error('x'))
package/src/core.ts CHANGED
@@ -409,9 +409,6 @@ export class Analytics {
409
409
  this.enqueue('event', event, { properties, ...commerce })
410
410
  }
411
411
 
412
- /** track is an alias of capture (Segment familiarity). */
413
- track = this.capture.bind(this)
414
-
415
412
  /** captureError reports a caught error, an unhandled rejection, a React render
416
413
  * error, or a manual report to BOTH planes, from one call:
417
414
  *
@@ -483,9 +480,6 @@ export class Analytics {
483
480
  }
484
481
  }
485
482
 
486
- /** captureException — @sentry-familiar alias of captureError. */
487
- captureException = this.captureError.bind(this)
488
-
489
483
  /** setCohort persists cohort dimensions (e.g. signupWeek at signup) so they ride
490
484
  * every subsequent event. */
491
485
  setCohort(patch: Cohort): void {
package/src/version.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  // The library version, stamped on every event (`libraryVersion`) and on the
2
2
  // Sentry `sdk` block. It lives alone so `sentry.ts` can read it without importing
3
3
  // `core.ts` — core imports sentry, so the reverse would be an import cycle.
4
- export const VERSION = '0.3.30'
4
+ export const VERSION = '0.3.32'