@hanzo/event 0.3.18 → 0.3.19

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.d.cts CHANGED
@@ -6,7 +6,7 @@ declare function getFirstTouch(): Attribution | undefined;
6
6
  /** Read persisted cohort dimensions. */
7
7
  declare function getCohort(): Cohort | undefined;
8
8
 
9
- declare const VERSION = "0.3.18";
9
+ declare const VERSION = "0.3.19";
10
10
 
11
11
  /**
12
12
  * parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
@@ -102,12 +102,19 @@ declare function uuidv7Time(id: string): number;
102
102
  * (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
103
103
  * product name the app passes to `createAnalytics`.
104
104
  */
105
- /** PRODUCT_DSN maps a `product` to the DSN its errors are submitted to. */
106
- declare const PRODUCT_DSN: Readonly<Record<string, string>>;
107
- /** dsnForProduct resolves the registered DSN for a product, or undefined when the
108
- * product has no project yet which leaves the error plane inert rather than
109
- * guessing a destination and silently posting a surface's errors into the wrong
110
- * project. */
105
+ /** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
106
+ * longer a per-project secret — it is the ONE org publishable key (below), so a
107
+ * surface's errors ride the SAME key its events do. The id only names WHICH
108
+ * project the errors group under, and cloud auto-provisions that project on first
109
+ * keyed ingest, so a new id needs nothing minted. `site` lives in the `hanzo-ai`
110
+ * project — an explicit map, because the projects predate this and do not derive
111
+ * cleanly from the product name. */
112
+ declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
113
+ /** dsnForProduct builds the product's Sentry DSN — the ONE org publishable key at
114
+ * its project's envelope endpoint — or undefined when the product has no project
115
+ * yet, which leaves the error plane inert rather than posting into the wrong one.
116
+ * Same key as the event stream: cloud resolves it to the org and attributes the
117
+ * errors there. */
111
118
  declare function dsnForProduct(product: string | undefined): string | undefined;
112
119
 
113
120
  /** redactSecrets removes known secret shapes. Always applied. */
@@ -290,4 +297,4 @@ declare function hasAttribution(a: Attribution): boolean;
290
297
  /** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
291
298
  declare function isoWeek(d: Date): string;
292
299
 
293
- export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_DSN, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
300
+ export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ declare function getFirstTouch(): Attribution | undefined;
6
6
  /** Read persisted cohort dimensions. */
7
7
  declare function getCohort(): Cohort | undefined;
8
8
 
9
- declare const VERSION = "0.3.18";
9
+ declare const VERSION = "0.3.19";
10
10
 
11
11
  /**
12
12
  * parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
@@ -102,12 +102,19 @@ declare function uuidv7Time(id: string): number;
102
102
  * (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
103
103
  * product name the app passes to `createAnalytics`.
104
104
  */
105
- /** PRODUCT_DSN maps a `product` to the DSN its errors are submitted to. */
106
- declare const PRODUCT_DSN: Readonly<Record<string, string>>;
107
- /** dsnForProduct resolves the registered DSN for a product, or undefined when the
108
- * product has no project yet which leaves the error plane inert rather than
109
- * guessing a destination and silently posting a surface's errors into the wrong
110
- * project. */
105
+ /** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
106
+ * longer a per-project secret — it is the ONE org publishable key (below), so a
107
+ * surface's errors ride the SAME key its events do. The id only names WHICH
108
+ * project the errors group under, and cloud auto-provisions that project on first
109
+ * keyed ingest, so a new id needs nothing minted. `site` lives in the `hanzo-ai`
110
+ * project — an explicit map, because the projects predate this and do not derive
111
+ * cleanly from the product name. */
112
+ declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
113
+ /** dsnForProduct builds the product's Sentry DSN — the ONE org publishable key at
114
+ * its project's envelope endpoint — or undefined when the product has no project
115
+ * yet, which leaves the error plane inert rather than posting into the wrong one.
116
+ * Same key as the event stream: cloud resolves it to the org and attributes the
117
+ * errors there. */
111
118
  declare function dsnForProduct(product: string | undefined): string | undefined;
112
119
 
113
120
  /** redactSecrets removes known secret shapes. Always applied. */
@@ -290,4 +297,4 @@ declare function hasAttribution(a: Attribution): boolean;
290
297
  /** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
291
298
  declare function isoWeek(d: Date): string;
292
299
 
293
- export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_DSN, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
300
+ export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
package/dist/index.mjs CHANGED
@@ -72,17 +72,19 @@ function isoWeek(d) {
72
72
  }
73
73
 
74
74
  // src/dsn.ts
75
- var PRODUCT_DSN = Object.freeze({
76
- // hanzo-console — console.hanzo.ai (also served embedded by the cloud binary)
77
- console: "https://1:0c8054dbde157f4f420c56b58660052b2ad782293c4de1d606ef8fbc46a0bf34@api.hanzo.ai/v1/sentry/019fa40b-94ae-7f1d-8f7b-e92f123fad42",
78
- // hanzo-app — hanzo.app
79
- app: "https://1:b3e1173125568c80f91ef4b1fabbbd2d7e22341de02b33ce7e22ef4fc16a196e@api.hanzo.ai/v1/sentry/019f9b1e-57eb-7171-9d92-72c0b85e4b4b",
80
- // hanzo-ai — hanzo.ai (the marketing site; `site` is the product name it declares)
81
- site: "https://1:d9cbfb844958bd7ef2a455600f00fbf237fbd71b75c1504f137773096d6aa53f@api.hanzo.ai/v1/sentry/019f9b1e-5785-7359-ad0b-f75db8e58c99"
75
+ var PRODUCT_PROJECT = Object.freeze({
76
+ console: "019fa40b-94ae-7f1d-8f7b-e92f123fad42",
77
+ // console.hanzo.ai
78
+ app: "019f9b1e-57eb-7171-9d92-72c0b85e4b4b",
79
+ // hanzo.app
80
+ site: "019f9b1e-5785-7359-ad0b-f75db8e58c99"
81
+ // hanzo.ai (marketing; product `site`)
82
82
  });
83
83
  function dsnForProduct(product) {
84
84
  if (!product) return void 0;
85
- return PRODUCT_DSN[product];
85
+ const projectId = PRODUCT_PROJECT[product];
86
+ if (!projectId) return void 0;
87
+ return `https://${HANZO_PUBLISHABLE_KEY}@api.hanzo.ai/v1/sentry/${projectId}`;
86
88
  }
87
89
  var HANZO_PUBLISHABLE_KEY = "pk-live-c88649f1085fb6ad441d8a0072933a9b";
88
90
  function defaultPublishableKey(host) {
@@ -369,7 +371,7 @@ function uuidv7Time(id) {
369
371
  }
370
372
 
371
373
  // src/version.ts
372
- var VERSION = "0.3.18";
374
+ var VERSION = "0.3.19";
373
375
 
374
376
  // src/sentry.ts
375
377
  var MAX_FRAMES = 50;
@@ -1146,6 +1148,6 @@ var COHORTS = {
1146
1148
  * reformat of one copy is a diff against the other.
1147
1149
  */
1148
1150
 
1149
- export { Analytics, COHORTS, EVENTS, FUNNELS, GOALS, PAGEVIEW, PRODUCTS, PRODUCT_DSN, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
1151
+ export { Analytics, COHORTS, EVENTS, FUNNELS, GOALS, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
1150
1152
  //# sourceMappingURL=index.mjs.map
1151
1153
  //# sourceMappingURL=index.mjs.map