@heycatch/sdk 0.7.0-dev.714 → 0.7.0-dev.974
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/README.md +57 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +2 -2
- package/dist/react-native.cjs +1 -1
- package/dist/react-native.d.cts +20 -2
- package/dist/react-native.d.ts +20 -2
- package/dist/react-native.js +1 -1
- package/dist/server.cjs +2 -2
- package/dist/server.d.cts +30 -3
- package/dist/server.d.ts +30 -3
- package/dist/server.js +2 -2
- package/dist/{shared-X3O5yyhh.d.cts → shared-CaIZ-Tgs.d.cts} +72 -1
- package/dist/{shared-X3O5yyhh.d.ts → shared-CaIZ-Tgs.d.ts} +72 -1
- package/package.json +1 -1
|
@@ -115,6 +115,34 @@ declare const STAGE: "dev" | "prod";
|
|
|
115
115
|
declare const SDK_VERSION: string;
|
|
116
116
|
/** Stamped when the installer could not determine a value. */
|
|
117
117
|
declare const UNKNOWN_INSTALL_VALUE: "unknown";
|
|
118
|
+
/**
|
|
119
|
+
* One captured event, as {@link HeyCatchBeforeSend} sees it just before it
|
|
120
|
+
* is queued for sending.
|
|
121
|
+
*
|
|
122
|
+
* Declared structurally, listing only the fields the SDK can promise. The
|
|
123
|
+
* index signature carries the underlying transport's own extra keys through
|
|
124
|
+
* untouched, so nothing is lost and nothing here has to move when they
|
|
125
|
+
* change.
|
|
126
|
+
*/
|
|
127
|
+
interface HeyCatchCapturedEvent {
|
|
128
|
+
/** Event name - an autocapture name like `$autocapture`, or your own. */
|
|
129
|
+
event: string;
|
|
130
|
+
/** The event's property bag, as it will be sent. */
|
|
131
|
+
properties: Record<string, unknown>;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Runs on every event right before it is queued. Return the event to keep
|
|
136
|
+
* it (mutated or not), or `null` to drop it.
|
|
137
|
+
*
|
|
138
|
+
* The SDK never calls this itself and never reads its return value - it
|
|
139
|
+
* forwards the function to the transport, whose own code calls it.
|
|
140
|
+
*/
|
|
141
|
+
type HeyCatchBeforeSend = (event: HeyCatchCapturedEvent | null) => HeyCatchCapturedEvent | null;
|
|
142
|
+
/** The transport's older, deprecated hook. Prefer {@link HeyCatchBeforeSend}. */
|
|
143
|
+
type HeyCatchSanitizeProperties = (properties: Record<string, unknown>, eventName: string) => Record<string, unknown>;
|
|
144
|
+
/** Where the SDK may persist the distinct id and super properties. */
|
|
145
|
+
type HeyCatchPersistence = 'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage';
|
|
118
146
|
/**
|
|
119
147
|
* Frameworks the install guides can detect. **Written out as a union, not
|
|
120
148
|
* derived from the array below**, because
|
|
@@ -175,6 +203,49 @@ interface HeyCatchConfig {
|
|
|
175
203
|
* are covered automatically - omit this unless the API lives elsewhere.
|
|
176
204
|
*/
|
|
177
205
|
tracingHosts?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* Turn off autocapture (clicks and form submissions). Pageviews,
|
|
208
|
+
* page-leaves, and rage-clicks are captured separately and are NOT
|
|
209
|
+
* affected by this one. Costs the recap's friction signals - the web
|
|
210
|
+
* entry logs this once at `init()` so the tradeoff isn't silent.
|
|
211
|
+
*/
|
|
212
|
+
autocapture?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Strip autocaptured elements' text content. Costs the recap's friction
|
|
215
|
+
* labels - logged once at `init()`.
|
|
216
|
+
*/
|
|
217
|
+
maskAllText?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Strip autocaptured elements' attributes. Costs debugging context on
|
|
220
|
+
* autocaptured events - logged once at `init()`.
|
|
221
|
+
*/
|
|
222
|
+
maskAllElementAttributes?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Property keys to drop from every captured event. HeyCatch's own
|
|
225
|
+
* `heycatch_*` attribution keys cannot be denylisted - they are what
|
|
226
|
+
* attributes an event to your project, so they are filtered back out
|
|
227
|
+
* (and named in the console) rather than silently honoured.
|
|
228
|
+
*/
|
|
229
|
+
propertyDenylist?: string[];
|
|
230
|
+
/** @deprecated Superseded by {@link HeyCatchConfig.beforeSend}. */
|
|
231
|
+
sanitizeProperties?: HeyCatchSanitizeProperties;
|
|
232
|
+
/** Runs on every event right before it is queued; return `null` to drop it. */
|
|
233
|
+
beforeSend?: HeyCatchBeforeSend | HeyCatchBeforeSend[];
|
|
234
|
+
/** Where the SDK persists the distinct id and super properties. */
|
|
235
|
+
persistence?: HeyCatchPersistence;
|
|
236
|
+
/** Disable persistence entirely - every pageload starts a new anonymous person. */
|
|
237
|
+
disablePersistence?: boolean;
|
|
238
|
+
/** Days before the persistence cookie expires. Defaults to 365. */
|
|
239
|
+
cookieExpirationDays?: number;
|
|
240
|
+
/**
|
|
241
|
+
* Start with capturing off until the app calls
|
|
242
|
+
* `analytics.optInCapturing()` - a proper consent gate instead of the
|
|
243
|
+
* "don't call init" workaround. Browser storage is held off too, not
|
|
244
|
+
* just sending, so no distinct id is written before consent.
|
|
245
|
+
*/
|
|
246
|
+
optOutCapturingByDefault?: boolean;
|
|
247
|
+
/** Honor the browser's Do Not Track signal. */
|
|
248
|
+
respectDnt?: boolean;
|
|
178
249
|
}
|
|
179
250
|
|
|
180
|
-
export { type
|
|
251
|
+
export { type HeyCatchBeforeSend as H, KNOWN_FRAMEWORKS as K, type PersonPropertyUpdate as P, SDK_VERSION as S, type TrackOptions as T, UNKNOWN_INSTALL_VALUE as U, type HeyCatchCapturedEvent as a, type HeyCatchConfig as b, type HeyCatchPersistence as c, type HeyCatchPersonProperties as d, type HeyCatchProperties as e, type HeyCatchSanitizeProperties as f, KNOWN_INSTALL_AGENTS as g, STAGE as h, type ServerTrackOptions as i };
|
|
@@ -115,6 +115,34 @@ declare const STAGE: "dev" | "prod";
|
|
|
115
115
|
declare const SDK_VERSION: string;
|
|
116
116
|
/** Stamped when the installer could not determine a value. */
|
|
117
117
|
declare const UNKNOWN_INSTALL_VALUE: "unknown";
|
|
118
|
+
/**
|
|
119
|
+
* One captured event, as {@link HeyCatchBeforeSend} sees it just before it
|
|
120
|
+
* is queued for sending.
|
|
121
|
+
*
|
|
122
|
+
* Declared structurally, listing only the fields the SDK can promise. The
|
|
123
|
+
* index signature carries the underlying transport's own extra keys through
|
|
124
|
+
* untouched, so nothing is lost and nothing here has to move when they
|
|
125
|
+
* change.
|
|
126
|
+
*/
|
|
127
|
+
interface HeyCatchCapturedEvent {
|
|
128
|
+
/** Event name - an autocapture name like `$autocapture`, or your own. */
|
|
129
|
+
event: string;
|
|
130
|
+
/** The event's property bag, as it will be sent. */
|
|
131
|
+
properties: Record<string, unknown>;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Runs on every event right before it is queued. Return the event to keep
|
|
136
|
+
* it (mutated or not), or `null` to drop it.
|
|
137
|
+
*
|
|
138
|
+
* The SDK never calls this itself and never reads its return value - it
|
|
139
|
+
* forwards the function to the transport, whose own code calls it.
|
|
140
|
+
*/
|
|
141
|
+
type HeyCatchBeforeSend = (event: HeyCatchCapturedEvent | null) => HeyCatchCapturedEvent | null;
|
|
142
|
+
/** The transport's older, deprecated hook. Prefer {@link HeyCatchBeforeSend}. */
|
|
143
|
+
type HeyCatchSanitizeProperties = (properties: Record<string, unknown>, eventName: string) => Record<string, unknown>;
|
|
144
|
+
/** Where the SDK may persist the distinct id and super properties. */
|
|
145
|
+
type HeyCatchPersistence = 'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage';
|
|
118
146
|
/**
|
|
119
147
|
* Frameworks the install guides can detect. **Written out as a union, not
|
|
120
148
|
* derived from the array below**, because
|
|
@@ -175,6 +203,49 @@ interface HeyCatchConfig {
|
|
|
175
203
|
* are covered automatically - omit this unless the API lives elsewhere.
|
|
176
204
|
*/
|
|
177
205
|
tracingHosts?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* Turn off autocapture (clicks and form submissions). Pageviews,
|
|
208
|
+
* page-leaves, and rage-clicks are captured separately and are NOT
|
|
209
|
+
* affected by this one. Costs the recap's friction signals - the web
|
|
210
|
+
* entry logs this once at `init()` so the tradeoff isn't silent.
|
|
211
|
+
*/
|
|
212
|
+
autocapture?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Strip autocaptured elements' text content. Costs the recap's friction
|
|
215
|
+
* labels - logged once at `init()`.
|
|
216
|
+
*/
|
|
217
|
+
maskAllText?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Strip autocaptured elements' attributes. Costs debugging context on
|
|
220
|
+
* autocaptured events - logged once at `init()`.
|
|
221
|
+
*/
|
|
222
|
+
maskAllElementAttributes?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Property keys to drop from every captured event. HeyCatch's own
|
|
225
|
+
* `heycatch_*` attribution keys cannot be denylisted - they are what
|
|
226
|
+
* attributes an event to your project, so they are filtered back out
|
|
227
|
+
* (and named in the console) rather than silently honoured.
|
|
228
|
+
*/
|
|
229
|
+
propertyDenylist?: string[];
|
|
230
|
+
/** @deprecated Superseded by {@link HeyCatchConfig.beforeSend}. */
|
|
231
|
+
sanitizeProperties?: HeyCatchSanitizeProperties;
|
|
232
|
+
/** Runs on every event right before it is queued; return `null` to drop it. */
|
|
233
|
+
beforeSend?: HeyCatchBeforeSend | HeyCatchBeforeSend[];
|
|
234
|
+
/** Where the SDK persists the distinct id and super properties. */
|
|
235
|
+
persistence?: HeyCatchPersistence;
|
|
236
|
+
/** Disable persistence entirely - every pageload starts a new anonymous person. */
|
|
237
|
+
disablePersistence?: boolean;
|
|
238
|
+
/** Days before the persistence cookie expires. Defaults to 365. */
|
|
239
|
+
cookieExpirationDays?: number;
|
|
240
|
+
/**
|
|
241
|
+
* Start with capturing off until the app calls
|
|
242
|
+
* `analytics.optInCapturing()` - a proper consent gate instead of the
|
|
243
|
+
* "don't call init" workaround. Browser storage is held off too, not
|
|
244
|
+
* just sending, so no distinct id is written before consent.
|
|
245
|
+
*/
|
|
246
|
+
optOutCapturingByDefault?: boolean;
|
|
247
|
+
/** Honor the browser's Do Not Track signal. */
|
|
248
|
+
respectDnt?: boolean;
|
|
178
249
|
}
|
|
179
250
|
|
|
180
|
-
export { type
|
|
251
|
+
export { type HeyCatchBeforeSend as H, KNOWN_FRAMEWORKS as K, type PersonPropertyUpdate as P, SDK_VERSION as S, type TrackOptions as T, UNKNOWN_INSTALL_VALUE as U, type HeyCatchCapturedEvent as a, type HeyCatchConfig as b, type HeyCatchPersistence as c, type HeyCatchPersonProperties as d, type HeyCatchProperties as e, type HeyCatchSanitizeProperties as f, KNOWN_INSTALL_AGENTS as g, STAGE as h, type ServerTrackOptions as i };
|