@hanzo/event 0.3.15 → 0.3.17

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/TAXONOMY.md CHANGED
@@ -239,7 +239,7 @@ Verified against the trees at the time of writing. ✅ = emitting, ❌ = not emi
239
239
  no org today; chat funnels are person-scoped only.
240
240
  5. **Logged-out reach depends on a publishable key.** Anonymous events need
241
241
  `ingestKey` (`pk_…`, write-only) or they fail closed at the door.
242
- `NEXT_PUBLIC_HANZO_INGEST_KEY` (hanzo.ai), `NEXT_PUBLIC_EVENT_INGEST_KEY`
242
+ `NEXT_PUBLIC_HANZO_INGEST_KEY` (hanzo.ai), `NEXT_PUBLIC_PUBLISHABLE_KEY`
243
243
  (hanzo.app), `VITE_HANZO_INGEST_KEY` (hanzo.chat) are read but must be
244
244
  provisioned per org via `POST /v1/ingest/keys`. Config, not code.
245
245
 
@@ -108,11 +108,11 @@ interface AnalyticsConfig {
108
108
  * a reading principal — so it is safe to ship in a bundle. Mint one per org with
109
109
  * POST /v1/keys {"type":"publishable"}.
110
110
  *
111
- * Omit it and the client reads NEXT_PUBLIC_EVENT_INGEST_KEY from the inlined
111
+ * Omit it and the client reads NEXT_PUBLIC_PUBLISHABLE_KEY from the inlined
112
112
  * build env, the same way `dsn` falls back — so a surface declares BOTH planes
113
113
  * in its build and neither needs code to switch on. That is the ONE spelling
114
- * the fleet already carries: KMS holds deploy/EVENT_INGEST_KEY, and each
115
- * Dockerfile takes EVENT_INGEST_KEY as a build-arg and re-exports it with the
114
+ * the fleet already carries: KMS holds deploy/PUBLISHABLE_KEY, and each
115
+ * Dockerfile takes PUBLISHABLE_KEY as a build-arg and re-exports it with the
116
116
  * NEXT_PUBLIC_ prefix that makes Next inline it.
117
117
  *
118
118
  * A surface with no key at all still reports for whoever is SIGNED IN (the
@@ -108,11 +108,11 @@ interface AnalyticsConfig {
108
108
  * a reading principal — so it is safe to ship in a bundle. Mint one per org with
109
109
  * POST /v1/keys {"type":"publishable"}.
110
110
  *
111
- * Omit it and the client reads NEXT_PUBLIC_EVENT_INGEST_KEY from the inlined
111
+ * Omit it and the client reads NEXT_PUBLIC_PUBLISHABLE_KEY from the inlined
112
112
  * build env, the same way `dsn` falls back — so a surface declares BOTH planes
113
113
  * in its build and neither needs code to switch on. That is the ONE spelling
114
- * the fleet already carries: KMS holds deploy/EVENT_INGEST_KEY, and each
115
- * Dockerfile takes EVENT_INGEST_KEY as a build-arg and re-exports it with the
114
+ * the fleet already carries: KMS holds deploy/PUBLISHABLE_KEY, and each
115
+ * Dockerfile takes PUBLISHABLE_KEY as a build-arg and re-exports it with the
116
116
  * NEXT_PUBLIC_ prefix that makes Next inline it.
117
117
  *
118
118
  * A surface with no key at all still reports for whoever is SIGNED IN (the
package/dist/index.cjs CHANGED
@@ -367,7 +367,7 @@ function uuidv7Time(id) {
367
367
  }
368
368
 
369
369
  // src/version.ts
370
- var VERSION = "0.3.15";
370
+ var VERSION = "0.3.17";
371
371
 
372
372
  // src/sentry.ts
373
373
  var MAX_FRAMES = 50;
@@ -661,7 +661,7 @@ function normalizeError2(err) {
661
661
  const n = normalizeError(err);
662
662
  return { type: n.name, message: n.message, stack: n.stack };
663
663
  }
664
- var isBrowser = () => typeof window !== "undefined";
664
+ var isBrowser = () => typeof window !== "undefined" && typeof document !== "undefined";
665
665
  function serializeBatch(batch) {
666
666
  try {
667
667
  return JSON.stringify({ batch });
@@ -733,9 +733,9 @@ var Analytics = class {
733
733
  // The publishable key resolves the SAME way the DSN below does: an explicit
734
734
  // config wins, else the inlined build-time env.
735
735
  //
736
- // NEXT_PUBLIC_EVENT_INGEST_KEY is that env, and it is the name the fleet
737
- // ALREADY carries end to end — KMS holds deploy/EVENT_INGEST_KEY, each
738
- // Dockerfile takes it as the EVENT_INGEST_KEY build-arg and re-exports it
736
+ // NEXT_PUBLIC_PUBLISHABLE_KEY is that env, and it is the name the fleet
737
+ // ALREADY carries end to end — KMS holds deploy/PUBLISHABLE_KEY, each
738
+ // Dockerfile takes it as the PUBLISHABLE_KEY build-arg and re-exports it
739
739
  // with the NEXT_PUBLIC_ prefix Next needs to inline it. Reading anything
740
740
  // else here would add a fourth spelling of one value.
741
741
  //
@@ -745,7 +745,7 @@ var Analytics = class {
745
745
  // unattributed write is refused (401 ingest_key_required), which is silent
746
746
  // in the page and invisible until you read the warehouse and find the host
747
747
  // missing entirely.
748
- ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_EVENT_INGEST_KEY")
748
+ ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY")
749
749
  };
750
750
  this.transport = config.transport ?? new DefaultTransport();
751
751
  this.dsn = parseDsn(config.dsn ?? readEnvDsn() ?? dsnForProduct(this.cfg.product));