@hanzo/event 0.3.20 → 0.3.21

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/react.mjs CHANGED
@@ -76,15 +76,11 @@ var PRODUCT_PROJECT = Object.freeze({
76
76
  site: "019f9b1e-5785-7359-ad0b-f75db8e58c99"
77
77
  // hanzo.ai (marketing; product `site`)
78
78
  });
79
- function dsnForProduct(product) {
80
- if (!product) return void 0;
79
+ function dsnForProduct(product, key) {
80
+ if (!product || !key) return void 0;
81
81
  const projectId = PRODUCT_PROJECT[product];
82
82
  if (!projectId) return void 0;
83
- return `https://${HANZO_PUBLISHABLE_KEY}@api.hanzo.ai/v1/sentry/${projectId}`;
84
- }
85
- var HANZO_PUBLISHABLE_KEY = "pk-live-c88649f1085fb6ad441d8a0072933a9b";
86
- function defaultPublishableKey(host) {
87
- return host === void 0 || host === "https://api.hanzo.ai" ? HANZO_PUBLISHABLE_KEY : void 0;
83
+ return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
88
84
  }
89
85
 
90
86
  // src/events.ts
@@ -314,7 +310,7 @@ function hzAnonId() {
314
310
  }
315
311
 
316
312
  // src/version.ts
317
- var VERSION = "0.3.20";
313
+ var VERSION = "0.3.21";
318
314
 
319
315
  // src/sentry.ts
320
316
  var MAX_FRAMES = 50;
@@ -765,27 +761,24 @@ var Analytics = class {
765
761
  enabled: true,
766
762
  captureErrors: true,
767
763
  ...config,
768
- // The publishable key resolves the SAME way the DSN below does, and now
769
- // ends the SAME way too — in a baked default, so declaring nothing is
770
- // enough. Most specific first:
764
+ // The publishable key resolves from ONE live source, never a literal baked
765
+ // beside the code. Most specific first:
771
766
  // 1. an explicit `ingestKey` in config;
772
767
  // 2. NEXT_PUBLIC_PUBLISHABLE_KEY, the inlined build-time env the fleet
773
- // carries end to end (KMS `deploy/PUBLISHABLE_KEY` -> the PUBLISHABLE_KEY
774
- // build-arg -> the NEXT_PUBLIC_ prefix Next inlines);
775
- // 3. the hanzo org key baked in `dsn.ts`, on the hanzo cloud only.
768
+ // carries end to end KMS `deploy/PUBLISHABLE_KEY` -> the PUBLISHABLE_KEY
769
+ // build-arg -> the NEXT_PUBLIC_ prefix Next inlines.
776
770
  //
777
- // (3) is why this is `publishable_key for all`: a hanzo surface that passes
778
- // no key in code and inlines no env still emits attributed, exactly as
779
- // declaring `product` is enough for the DSN. Without it that surface sent
780
- // its beacons to `$public` which drops every track/identify/group and
781
- // still answers 200 silent in the page and invisible until you read the
782
- // warehouse and find the host missing entirely. A white-label surface on
783
- // its own cloud (a non-default host) gets no default, so the org this
784
- // attributes to is never the wrong one.
785
- ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY") ?? defaultPublishableKey(config.host ?? DEFAULT_HOST)
771
+ // A surface that provides neither has no key, and its anonymous traffic
772
+ // files under `$public` (which drops track/identify/group and answers 200);
773
+ // the fix is to give it the KMS-sourced env, not to hardcode the org key
774
+ // here. The key is a credential-class value: its home is KMS, and the ONE
775
+ // build reads it from there.
776
+ ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY")
786
777
  };
787
778
  this.transport = config.transport ?? new DefaultTransport();
788
- this.dsn = parseDsn(config.dsn ?? readEnvDsn() ?? dsnForProduct(this.cfg.product));
779
+ this.dsn = parseDsn(
780
+ config.dsn ?? readEnvDsn() ?? dsnForProduct(this.cfg.product, this.cfg.ingestKey)
781
+ );
789
782
  }
790
783
  /** errorPlaneEnabled reports whether captured exceptions can actually reach the
791
784
  * error host. False means a DSN was never configured — the documented