@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.cjs +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -8
- package/dist/index.d.ts +15 -8
- package/dist/index.mjs +12 -10
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +11 -9
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +11 -9
- package/dist/react.mjs.map +1 -1
- package/hz.js +1 -1
- package/package.json +1 -1
- package/src/dsn.test.ts +14 -11
- package/src/dsn.ts +19 -14
- package/src/index.ts +1 -1
- package/src/version.ts +1 -1
package/src/dsn.ts
CHANGED
|
@@ -24,24 +24,29 @@
|
|
|
24
24
|
* product name the app passes to `createAnalytics`.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
* project — an 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
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
/** dsnForProduct builds the product's Sentry DSN — the ONE org publishable key at
|
|
41
|
+
* its project's envelope endpoint — or 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
|
-
|
|
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 {
|
|
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.
|
|
4
|
+
export const VERSION = '0.3.19'
|