@hanzo/event 0.3.20 → 0.3.22
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 +61 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -58
- package/dist/index.d.ts +12 -58
- package/dist/index.mjs +21 -78
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +20 -30
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +18 -28
- package/dist/react.mjs.map +1 -1
- package/hz.js +7 -8
- package/package.json +4 -1
- package/src/core.test.ts +3 -37
- package/src/core.ts +18 -24
- package/src/dsn.test.ts +28 -18
- package/src/dsn.ts +14 -34
- package/src/events.ts +21 -76
- package/src/hz.test.ts +4 -10
- package/src/version.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-CHLpJy51.cjs';
|
|
2
2
|
export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-CHLpJy51.cjs';
|
|
3
|
+
export { EVENTS, EXCEPTION, EventName, PAGEVIEW } from '@hanzo/events';
|
|
3
4
|
|
|
4
5
|
/** Read the persisted first-touch attribution. */
|
|
5
6
|
declare function getFirstTouch(): Attribution | undefined;
|
|
6
7
|
/** Read persisted cohort dimensions. */
|
|
7
8
|
declare function getCohort(): Cohort | undefined;
|
|
8
9
|
|
|
9
|
-
declare const VERSION = "0.3.
|
|
10
|
+
declare const VERSION = "0.3.21";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
|
|
@@ -110,12 +111,15 @@ declare function uuidv7Time(id: string): number;
|
|
|
110
111
|
* project — an explicit map, because the projects predate this and do not derive
|
|
111
112
|
* cleanly from the product name. */
|
|
112
113
|
declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
|
|
113
|
-
/** dsnForProduct builds the product's Sentry DSN
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
|
|
114
|
+
/** dsnForProduct builds the product's Sentry DSN from the caller's resolved
|
|
115
|
+
* publishable `key` and the product's project — the SAME key the event stream
|
|
116
|
+
* carries, at the product's envelope endpoint. Returns undefined when there is no
|
|
117
|
+
* key or no project for the product, leaving the error plane inert rather than
|
|
118
|
+
* posting into the wrong one. The key is NOT baked here: it is the value the
|
|
119
|
+
* surface resolved (an explicit `ingestKey`, or the KMS-sourced
|
|
120
|
+
* NEXT_PUBLIC_PUBLISHABLE_KEY the build inlines) — the ONE live source, never a
|
|
121
|
+
* literal committed beside the code. */
|
|
122
|
+
declare function dsnForProduct(product: string | undefined, key: string | undefined): string | undefined;
|
|
119
123
|
|
|
120
124
|
/** redactSecrets removes known secret shapes. Always applied. */
|
|
121
125
|
declare function redactSecrets(s: string): string;
|
|
@@ -125,56 +129,6 @@ declare function scrubPII(s: string): string;
|
|
|
125
129
|
* first: unbounded text is a denial-of-service surface, not just a size problem. */
|
|
126
130
|
declare function scrubText(s: string | undefined, capturePII?: boolean): string;
|
|
127
131
|
|
|
128
|
-
declare const EVENTS: {
|
|
129
|
-
readonly SIGNUP_VIEWED: "signup_viewed";
|
|
130
|
-
readonly SIGNUP_SUBMITTED: "signup_submitted";
|
|
131
|
-
readonly SIGNUP_VERIFIED: "signup_verified";
|
|
132
|
-
readonly SIGNUP_COMPLETED: "signup_completed";
|
|
133
|
-
/** A RETURNING user authenticated — the non-signup half of the IAM callback.
|
|
134
|
-
* Keeping it distinct is what stops returning logins from inflating signups. */
|
|
135
|
-
readonly LOGIN_COMPLETED: "login_completed";
|
|
136
|
-
/** Activation: the first moment of real value. ONE event for every product —
|
|
137
|
-
* the product-specific moment is the `action` property (api_call, app_live,
|
|
138
|
-
* chat_reply), never a new event name. */
|
|
139
|
-
readonly FIRST_ACTION: "first_action";
|
|
140
|
-
readonly WAITLIST_JOINED: "waitlist_joined";
|
|
141
|
-
readonly WAITLIST_SHARED: "waitlist_shared";
|
|
142
|
-
readonly REFERRAL_USED: "referral_used";
|
|
143
|
-
readonly REFERRAL_CLAIMED: "referral_claimed";
|
|
144
|
-
readonly PRICING_VIEWED: "pricing_viewed";
|
|
145
|
-
readonly PLAN_CLICKED: "plan_clicked";
|
|
146
|
-
readonly CHECKOUT_STARTED: "checkout_started";
|
|
147
|
-
readonly ORDER_COMPLETED: "order_completed";
|
|
148
|
-
readonly FEATURE_USED: "feature_used";
|
|
149
|
-
readonly API_KEY_CREATED: "api_key_created";
|
|
150
|
-
readonly APP_CREATED: "app_created";
|
|
151
|
-
readonly PROJECT_CREATED: "project_created";
|
|
152
|
-
readonly AGENT_CREATED: "agent_created";
|
|
153
|
-
readonly CHAT_STARTED: "chat_started";
|
|
154
|
-
readonly CHAT_MESSAGE_SENT: "chat_message_sent";
|
|
155
|
-
/** The user switched model/endpoint — the single strongest quality signal a
|
|
156
|
-
* chat surface emits (a switch usually follows a bad answer). */
|
|
157
|
-
readonly MODEL_SWITCHED: "model_switched";
|
|
158
|
-
readonly TASK_STARTED: "task_started";
|
|
159
|
-
readonly TASK_COMPLETED: "task_completed";
|
|
160
|
-
readonly BUILD_STARTED: "build_started";
|
|
161
|
-
/** A model finished producing an artifact (an app build, a chat reply, an agent
|
|
162
|
-
* run). Carries `durationMs` — the outcome event owns its own duration, so no
|
|
163
|
-
* paired start event is needed. */
|
|
164
|
-
readonly GENERATION_COMPLETED: "generation_completed";
|
|
165
|
-
readonly GENERATION_FAILED: "generation_failed";
|
|
166
|
-
readonly DEPLOY_STARTED: "deploy_started";
|
|
167
|
-
readonly DEPLOY_SUCCEEDED: "deploy_succeeded";
|
|
168
|
-
readonly DEPLOY_FAILED: "deploy_failed";
|
|
169
|
-
};
|
|
170
|
-
type EventName = (typeof EVENTS)[keyof typeof EVENTS];
|
|
171
|
-
/** The reserved event name a pageview is stored under (server + read lens). */
|
|
172
|
-
declare const PAGEVIEW = "$pageview";
|
|
173
|
-
/** The reserved name every captured exception is emitted under. Error Tracking
|
|
174
|
-
* reads exactly this name; an exception emitted under its own message instead
|
|
175
|
-
* makes every distinct message a permanent entry in the event taxonomy. */
|
|
176
|
-
declare const EXCEPTION = "$exception";
|
|
177
|
-
|
|
178
132
|
/**
|
|
179
133
|
* digest is a stable 32-hex-char (128-bit) content hash, computed synchronously.
|
|
180
134
|
*
|
|
@@ -350,4 +304,4 @@ declare function hasAttribution(a: Attribution): boolean;
|
|
|
350
304
|
/** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
|
|
351
305
|
declare function isoWeek(d: Date): string;
|
|
352
306
|
|
|
353
|
-
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn,
|
|
307
|
+
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, type ErrorIdentity, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-CHLpJy51.js';
|
|
2
2
|
export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-CHLpJy51.js';
|
|
3
|
+
export { EVENTS, EXCEPTION, EventName, PAGEVIEW } from '@hanzo/events';
|
|
3
4
|
|
|
4
5
|
/** Read the persisted first-touch attribution. */
|
|
5
6
|
declare function getFirstTouch(): Attribution | undefined;
|
|
6
7
|
/** Read persisted cohort dimensions. */
|
|
7
8
|
declare function getCohort(): Cohort | undefined;
|
|
8
9
|
|
|
9
|
-
declare const VERSION = "0.3.
|
|
10
|
+
declare const VERSION = "0.3.21";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
|
|
@@ -110,12 +111,15 @@ declare function uuidv7Time(id: string): number;
|
|
|
110
111
|
* project — an explicit map, because the projects predate this and do not derive
|
|
111
112
|
* cleanly from the product name. */
|
|
112
113
|
declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
|
|
113
|
-
/** dsnForProduct builds the product's Sentry DSN
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
|
|
114
|
+
/** dsnForProduct builds the product's Sentry DSN from the caller's resolved
|
|
115
|
+
* publishable `key` and the product's project — the SAME key the event stream
|
|
116
|
+
* carries, at the product's envelope endpoint. Returns undefined when there is no
|
|
117
|
+
* key or no project for the product, leaving the error plane inert rather than
|
|
118
|
+
* posting into the wrong one. The key is NOT baked here: it is the value the
|
|
119
|
+
* surface resolved (an explicit `ingestKey`, or the KMS-sourced
|
|
120
|
+
* NEXT_PUBLIC_PUBLISHABLE_KEY the build inlines) — the ONE live source, never a
|
|
121
|
+
* literal committed beside the code. */
|
|
122
|
+
declare function dsnForProduct(product: string | undefined, key: string | undefined): string | undefined;
|
|
119
123
|
|
|
120
124
|
/** redactSecrets removes known secret shapes. Always applied. */
|
|
121
125
|
declare function redactSecrets(s: string): string;
|
|
@@ -125,56 +129,6 @@ declare function scrubPII(s: string): string;
|
|
|
125
129
|
* first: unbounded text is a denial-of-service surface, not just a size problem. */
|
|
126
130
|
declare function scrubText(s: string | undefined, capturePII?: boolean): string;
|
|
127
131
|
|
|
128
|
-
declare const EVENTS: {
|
|
129
|
-
readonly SIGNUP_VIEWED: "signup_viewed";
|
|
130
|
-
readonly SIGNUP_SUBMITTED: "signup_submitted";
|
|
131
|
-
readonly SIGNUP_VERIFIED: "signup_verified";
|
|
132
|
-
readonly SIGNUP_COMPLETED: "signup_completed";
|
|
133
|
-
/** A RETURNING user authenticated — the non-signup half of the IAM callback.
|
|
134
|
-
* Keeping it distinct is what stops returning logins from inflating signups. */
|
|
135
|
-
readonly LOGIN_COMPLETED: "login_completed";
|
|
136
|
-
/** Activation: the first moment of real value. ONE event for every product —
|
|
137
|
-
* the product-specific moment is the `action` property (api_call, app_live,
|
|
138
|
-
* chat_reply), never a new event name. */
|
|
139
|
-
readonly FIRST_ACTION: "first_action";
|
|
140
|
-
readonly WAITLIST_JOINED: "waitlist_joined";
|
|
141
|
-
readonly WAITLIST_SHARED: "waitlist_shared";
|
|
142
|
-
readonly REFERRAL_USED: "referral_used";
|
|
143
|
-
readonly REFERRAL_CLAIMED: "referral_claimed";
|
|
144
|
-
readonly PRICING_VIEWED: "pricing_viewed";
|
|
145
|
-
readonly PLAN_CLICKED: "plan_clicked";
|
|
146
|
-
readonly CHECKOUT_STARTED: "checkout_started";
|
|
147
|
-
readonly ORDER_COMPLETED: "order_completed";
|
|
148
|
-
readonly FEATURE_USED: "feature_used";
|
|
149
|
-
readonly API_KEY_CREATED: "api_key_created";
|
|
150
|
-
readonly APP_CREATED: "app_created";
|
|
151
|
-
readonly PROJECT_CREATED: "project_created";
|
|
152
|
-
readonly AGENT_CREATED: "agent_created";
|
|
153
|
-
readonly CHAT_STARTED: "chat_started";
|
|
154
|
-
readonly CHAT_MESSAGE_SENT: "chat_message_sent";
|
|
155
|
-
/** The user switched model/endpoint — the single strongest quality signal a
|
|
156
|
-
* chat surface emits (a switch usually follows a bad answer). */
|
|
157
|
-
readonly MODEL_SWITCHED: "model_switched";
|
|
158
|
-
readonly TASK_STARTED: "task_started";
|
|
159
|
-
readonly TASK_COMPLETED: "task_completed";
|
|
160
|
-
readonly BUILD_STARTED: "build_started";
|
|
161
|
-
/** A model finished producing an artifact (an app build, a chat reply, an agent
|
|
162
|
-
* run). Carries `durationMs` — the outcome event owns its own duration, so no
|
|
163
|
-
* paired start event is needed. */
|
|
164
|
-
readonly GENERATION_COMPLETED: "generation_completed";
|
|
165
|
-
readonly GENERATION_FAILED: "generation_failed";
|
|
166
|
-
readonly DEPLOY_STARTED: "deploy_started";
|
|
167
|
-
readonly DEPLOY_SUCCEEDED: "deploy_succeeded";
|
|
168
|
-
readonly DEPLOY_FAILED: "deploy_failed";
|
|
169
|
-
};
|
|
170
|
-
type EventName = (typeof EVENTS)[keyof typeof EVENTS];
|
|
171
|
-
/** The reserved event name a pageview is stored under (server + read lens). */
|
|
172
|
-
declare const PAGEVIEW = "$pageview";
|
|
173
|
-
/** The reserved name every captured exception is emitted under. Error Tracking
|
|
174
|
-
* reads exactly this name; an exception emitted under its own message instead
|
|
175
|
-
* makes every distinct message a permanent entry in the event taxonomy. */
|
|
176
|
-
declare const EXCEPTION = "$exception";
|
|
177
|
-
|
|
178
132
|
/**
|
|
179
133
|
* digest is a stable 32-hex-char (128-bit) content hash, computed synchronously.
|
|
180
134
|
*
|
|
@@ -350,4 +304,4 @@ declare function hasAttribution(a: Attribution): boolean;
|
|
|
350
304
|
/** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
|
|
351
305
|
declare function isoWeek(d: Date): string;
|
|
352
306
|
|
|
353
|
-
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn,
|
|
307
|
+
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, type ErrorIdentity, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { EVENTS, PAGEVIEW, EXCEPTION } from '@hanzo/events';
|
|
2
|
+
export { EVENTS, EXCEPTION, PAGEVIEW } from '@hanzo/events';
|
|
3
|
+
|
|
1
4
|
// src/attribution.ts
|
|
2
5
|
var SOCIAL_HOSTS = [
|
|
3
6
|
"facebook.",
|
|
@@ -80,70 +83,13 @@ var PRODUCT_PROJECT = Object.freeze({
|
|
|
80
83
|
site: "019f9b1e-5785-7359-ad0b-f75db8e58c99"
|
|
81
84
|
// hanzo.ai (marketing; product `site`)
|
|
82
85
|
});
|
|
83
|
-
function dsnForProduct(product) {
|
|
84
|
-
if (!product) return void 0;
|
|
86
|
+
function dsnForProduct(product, key) {
|
|
87
|
+
if (!product || !key) return void 0;
|
|
85
88
|
const projectId = PRODUCT_PROJECT[product];
|
|
86
89
|
if (!projectId) return void 0;
|
|
87
|
-
return `https://${
|
|
88
|
-
}
|
|
89
|
-
var HANZO_PUBLISHABLE_KEY = "pk-live-c88649f1085fb6ad441d8a0072933a9b";
|
|
90
|
-
function defaultPublishableKey(host) {
|
|
91
|
-
return host === void 0 || host === "https://api.hanzo.ai" ? HANZO_PUBLISHABLE_KEY : void 0;
|
|
90
|
+
return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
// src/events.ts
|
|
95
|
-
var EVENTS = {
|
|
96
|
-
// Signup funnel: view -> submit -> verify -> completed -> first action.
|
|
97
|
-
SIGNUP_VIEWED: "signup_viewed",
|
|
98
|
-
SIGNUP_SUBMITTED: "signup_submitted",
|
|
99
|
-
SIGNUP_VERIFIED: "signup_verified",
|
|
100
|
-
SIGNUP_COMPLETED: "signup_completed",
|
|
101
|
-
/** A RETURNING user authenticated — the non-signup half of the IAM callback.
|
|
102
|
-
* Keeping it distinct is what stops returning logins from inflating signups. */
|
|
103
|
-
LOGIN_COMPLETED: "login_completed",
|
|
104
|
-
/** Activation: the first moment of real value. ONE event for every product —
|
|
105
|
-
* the product-specific moment is the `action` property (api_call, app_live,
|
|
106
|
-
* chat_reply), never a new event name. */
|
|
107
|
-
FIRST_ACTION: "first_action",
|
|
108
|
-
// Waitlist + referral.
|
|
109
|
-
WAITLIST_JOINED: "waitlist_joined",
|
|
110
|
-
WAITLIST_SHARED: "waitlist_shared",
|
|
111
|
-
REFERRAL_USED: "referral_used",
|
|
112
|
-
REFERRAL_CLAIMED: "referral_claimed",
|
|
113
|
-
// Upgrade-intent + purchase.
|
|
114
|
-
PRICING_VIEWED: "pricing_viewed",
|
|
115
|
-
PLAN_CLICKED: "plan_clicked",
|
|
116
|
-
CHECKOUT_STARTED: "checkout_started",
|
|
117
|
-
ORDER_COMPLETED: "order_completed",
|
|
118
|
-
// Feature usage — generic + the common key surfaces across products.
|
|
119
|
-
FEATURE_USED: "feature_used",
|
|
120
|
-
API_KEY_CREATED: "api_key_created",
|
|
121
|
-
APP_CREATED: "app_created",
|
|
122
|
-
PROJECT_CREATED: "project_created",
|
|
123
|
-
AGENT_CREATED: "agent_created",
|
|
124
|
-
CHAT_STARTED: "chat_started",
|
|
125
|
-
CHAT_MESSAGE_SENT: "chat_message_sent",
|
|
126
|
-
/** The user switched model/endpoint — the single strongest quality signal a
|
|
127
|
-
* chat surface emits (a switch usually follows a bad answer). */
|
|
128
|
-
MODEL_SWITCHED: "model_switched",
|
|
129
|
-
TASK_STARTED: "task_started",
|
|
130
|
-
TASK_COMPLETED: "task_completed",
|
|
131
|
-
// Build → ship. `build_*` is a MODEL producing an artifact; `deploy_*` is that
|
|
132
|
-
// artifact going live. Intent (build_started) is never the same event as the
|
|
133
|
-
// artifact existing (app_created) — conflating them makes the funnel lie.
|
|
134
|
-
BUILD_STARTED: "build_started",
|
|
135
|
-
/** A model finished producing an artifact (an app build, a chat reply, an agent
|
|
136
|
-
* run). Carries `durationMs` — the outcome event owns its own duration, so no
|
|
137
|
-
* paired start event is needed. */
|
|
138
|
-
GENERATION_COMPLETED: "generation_completed",
|
|
139
|
-
GENERATION_FAILED: "generation_failed",
|
|
140
|
-
DEPLOY_STARTED: "deploy_started",
|
|
141
|
-
DEPLOY_SUCCEEDED: "deploy_succeeded",
|
|
142
|
-
DEPLOY_FAILED: "deploy_failed"
|
|
143
|
-
};
|
|
144
|
-
var PAGEVIEW = "$pageview";
|
|
145
|
-
var EXCEPTION = "$exception";
|
|
146
|
-
|
|
147
93
|
// src/scrub.ts
|
|
148
94
|
var REDACTED = "[redacted]";
|
|
149
95
|
var EMAIL_MARK = "[email]";
|
|
@@ -372,7 +318,7 @@ function uuidv7Time(id) {
|
|
|
372
318
|
}
|
|
373
319
|
|
|
374
320
|
// src/version.ts
|
|
375
|
-
var VERSION = "0.3.
|
|
321
|
+
var VERSION = "0.3.21";
|
|
376
322
|
|
|
377
323
|
// src/sentry.ts
|
|
378
324
|
var MAX_FRAMES = 50;
|
|
@@ -823,27 +769,24 @@ var Analytics = class {
|
|
|
823
769
|
enabled: true,
|
|
824
770
|
captureErrors: true,
|
|
825
771
|
...config,
|
|
826
|
-
// The publishable key resolves
|
|
827
|
-
//
|
|
828
|
-
// enough. Most specific first:
|
|
772
|
+
// The publishable key resolves from ONE live source, never a literal baked
|
|
773
|
+
// beside the code. Most specific first:
|
|
829
774
|
// 1. an explicit `ingestKey` in config;
|
|
830
775
|
// 2. NEXT_PUBLIC_PUBLISHABLE_KEY, the inlined build-time env the fleet
|
|
831
|
-
// carries end to end
|
|
832
|
-
// build-arg -> the NEXT_PUBLIC_ prefix Next inlines
|
|
833
|
-
// 3. the hanzo org key baked in `dsn.ts`, on the hanzo cloud only.
|
|
776
|
+
// carries end to end — KMS `deploy/PUBLISHABLE_KEY` -> the PUBLISHABLE_KEY
|
|
777
|
+
// build-arg -> the NEXT_PUBLIC_ prefix Next inlines.
|
|
834
778
|
//
|
|
835
|
-
//
|
|
836
|
-
//
|
|
837
|
-
//
|
|
838
|
-
//
|
|
839
|
-
//
|
|
840
|
-
|
|
841
|
-
// its own cloud (a non-default host) gets no default, so the org this
|
|
842
|
-
// attributes to is never the wrong one.
|
|
843
|
-
ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY") ?? defaultPublishableKey(config.host ?? DEFAULT_HOST)
|
|
779
|
+
// A surface that provides neither has no key, and its anonymous traffic
|
|
780
|
+
// files under `$public` (which drops track/identify/group and answers 200);
|
|
781
|
+
// the fix is to give it the KMS-sourced env, not to hardcode the org key
|
|
782
|
+
// here. The key is a credential-class value: its home is KMS, and the ONE
|
|
783
|
+
// build reads it from there.
|
|
784
|
+
ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY")
|
|
844
785
|
};
|
|
845
786
|
this.transport = config.transport ?? new DefaultTransport();
|
|
846
|
-
this.dsn = parseDsn(
|
|
787
|
+
this.dsn = parseDsn(
|
|
788
|
+
config.dsn ?? readEnvDsn() ?? dsnForProduct(this.cfg.product, this.cfg.ingestKey)
|
|
789
|
+
);
|
|
847
790
|
}
|
|
848
791
|
/** errorPlaneEnabled reports whether captured exceptions can actually reach the
|
|
849
792
|
* error host. False means a DSN was never configured — the documented
|
|
@@ -1248,6 +1191,6 @@ var COHORTS = {
|
|
|
1248
1191
|
* reformat of one copy is a diff against the other.
|
|
1249
1192
|
*/
|
|
1250
1193
|
|
|
1251
|
-
export { Analytics, COHORTS,
|
|
1194
|
+
export { Analytics, COHORTS, FUNNELS, GOALS, PRODUCTS, PRODUCT_PROJECT, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
|
1252
1195
|
//# sourceMappingURL=index.mjs.map
|
|
1253
1196
|
//# sourceMappingURL=index.mjs.map
|