@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/src/dsn.ts CHANGED
@@ -24,24 +24,29 @@
24
24
  * product name the app passes to `createAnalytics`.
25
25
  */
26
26
 
27
- /** PRODUCT_DSN maps a `product` to the DSN its errors are submitted to. */
28
- export const PRODUCT_DSN: Readonly<Record<string, string>> = Object.freeze({
29
- // hanzo-console console.hanzo.ai (also served embedded by the cloud binary)
30
- console:
31
- 'https://1:0c8054dbde157f4f420c56b58660052b2ad782293c4de1d606ef8fbc46a0bf34@api.hanzo.ai/v1/sentry/019fa40b-94ae-7f1d-8f7b-e92f123fad42',
32
- // hanzo-app hanzo.app
33
- app: 'https://1:b3e1173125568c80f91ef4b1fabbbd2d7e22341de02b33ce7e22ef4fc16a196e@api.hanzo.ai/v1/sentry/019f9b1e-57eb-7171-9d92-72c0b85e4b4b',
34
- // hanzo-ai hanzo.ai (the marketing site; `site` is the product name it declares)
35
- site: 'https://1:d9cbfb844958bd7ef2a455600f00fbf237fbd71b75c1504f137773096d6aa53f@api.hanzo.ai/v1/sentry/019f9b1e-5785-7359-ad0b-f75db8e58c99',
27
+ /** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
28
+ * longer a per-project secret it is the ONE org publishable key (below), so a
29
+ * surface's errors ride the SAME key its events do. The id only names WHICH
30
+ * project the errors group under, and cloud auto-provisions that project on first
31
+ * keyed ingest, so a new id needs nothing minted. `site` lives in the `hanzo-ai`
32
+ * projectan explicit map, because the projects predate this and do not derive
33
+ * cleanly from the product name. */
34
+ export const PRODUCT_PROJECT: Readonly<Record<string, string>> = Object.freeze({
35
+ console: '019fa40b-94ae-7f1d-8f7b-e92f123fad42', // console.hanzo.ai
36
+ app: '019f9b1e-57eb-7171-9d92-72c0b85e4b4b', // hanzo.app
37
+ site: '019f9b1e-5785-7359-ad0b-f75db8e58c99', // hanzo.ai (marketing; product `site`)
36
38
  })
37
39
 
38
- /** dsnForProduct resolves the registered DSN for a product, or undefined when the
39
- * product has no project yet which leaves the error plane inert rather than
40
- * guessing a destination and silently posting a surface's errors into the wrong
41
- * project. */
40
+ /** dsnForProduct builds the product's Sentry DSN the ONE org publishable key at
41
+ * its project's envelope endpointor undefined when the product has no project
42
+ * yet, which leaves the error plane inert rather than posting into the wrong one.
43
+ * Same key as the event stream: cloud resolves it to the org and attributes the
44
+ * errors there. */
42
45
  export function dsnForProduct(product: string | undefined): string | undefined {
43
46
  if (!product) return undefined
44
- return PRODUCT_DSN[product]
47
+ const projectId = PRODUCT_PROJECT[product]
48
+ if (!projectId) return undefined
49
+ return `https://${HANZO_PUBLISHABLE_KEY}@api.hanzo.ai/v1/sentry/${projectId}`
45
50
  }
46
51
 
47
52
  /** The hanzo org's publishable ingest key. Like the DSNs above it is PUBLIC by
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  export { Analytics, createAnalytics, VERSION, getCohort, getFirstTouch } from './core'
11
11
  export { parseDsn, buildSentryEvent, buildEnvelope, framesFromStack } from './sentry'
12
12
  export { uuidv7, uuidv7Time } from './uid'
13
- export { PRODUCT_DSN, dsnForProduct } from './dsn'
13
+ export { PRODUCT_PROJECT, dsnForProduct } from './dsn'
14
14
  export type { ErrorIdentity } from './sentry'
15
15
  export { scrubText, redactSecrets, scrubPII } from './scrub'
16
16
  export { EVENTS, PAGEVIEW } from './events'
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.18'
4
+ export const VERSION = '0.3.19'