@heycatch/sdk 0.6.0 → 0.7.0-dev.1029
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 +59 -1
- package/THIRD-PARTY-LICENSES.md +360 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +43 -76
- package/dist/index.d.ts +43 -76
- package/dist/index.js +2 -2
- package/dist/react-native.cjs +2 -0
- package/dist/react-native.d.cts +110 -0
- package/dist/react-native.d.ts +110 -0
- package/dist/react-native.js +2 -0
- package/dist/server.cjs +3 -0
- package/dist/server.d.cts +105 -0
- package/dist/server.d.ts +105 -0
- package/dist/server.js +3 -0
- package/dist/shared-CaIZ-Tgs.d.cts +251 -0
- package/dist/shared-CaIZ-Tgs.d.ts +251 -0
- package/package.json +53 -10
- package/AGENTS.md +0 -132
- package/docs/short-links.md +0 -69
package/dist/index.d.cts
CHANGED
|
@@ -1,70 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* runtime array: `apps/landing-web/tests/agent-install-guides.spec.ts`
|
|
4
|
-
* reads this source text and asserts the set matches the guides' tables,
|
|
5
|
-
* so docs, types, and reported values cannot drift.
|
|
6
|
-
*/
|
|
7
|
-
type KnownFramework = 'nextjs' | 'vite-react' | 'react' | 'vue' | 'svelte' | 'astro' | 'angular' | 'web';
|
|
8
|
-
/** Coding agents that run the install. `other` is the catch-all. */
|
|
9
|
-
type KnownInstallAgent = 'lovable' | 'bolt' | 'v0' | 'replit' | 'cursor' | 'claude-code' | 'codex' | 'windsurf' | 'other';
|
|
10
|
-
/**
|
|
11
|
-
* Who installed the SDK and into what. Stamped as super-properties on
|
|
12
|
-
* every event - the dashboard reads them off the event stream, so there
|
|
13
|
-
* is no separate install call to make or to fail.
|
|
14
|
-
*
|
|
15
|
-
* `(string & {})` keeps the known ids as editor completions while still
|
|
16
|
-
* accepting anything: a framework we haven't listed yet must not block
|
|
17
|
-
* an install.
|
|
18
|
-
*/
|
|
19
|
-
interface HeyCatchInstall {
|
|
20
|
-
/** Framework id from the install guide, e.g. `nextjs`. */
|
|
21
|
-
framework?: KnownFramework | (string & {});
|
|
22
|
-
/** That framework's major version, e.g. `15`. */
|
|
23
|
-
frameworkVersion?: string;
|
|
24
|
-
/** The agent doing the install, e.g. `claude-code`. */
|
|
25
|
-
agent?: KnownInstallAgent | (string & {});
|
|
26
|
-
}
|
|
27
|
-
/** Configuration for {@link init}. */
|
|
28
|
-
interface HeyCatchConfig {
|
|
29
|
-
/** Your project's publishable key (`hck_pk_...`). */
|
|
30
|
-
projectKey: string;
|
|
31
|
-
/** Install metadata, stamped on every event. Omit any field you can't determine. */
|
|
32
|
-
install?: HeyCatchInstall;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Initialize HeyCatch. Call once at the client-side entry point -
|
|
37
|
-
* autocapture starts immediately, nothing else to instrument.
|
|
38
|
-
* Idempotent and a safe no-op on the server.
|
|
39
|
-
*/
|
|
40
|
-
declare function init(config: HeyCatchConfig): void;
|
|
1
|
+
import { d as HeyCatchPersonProperties, b as HeyCatchConfig, e as HeyCatchProperties, T as TrackOptions } from './shared-CaIZ-Tgs.cjs';
|
|
2
|
+
export { H as HeyCatchBeforeSend, a as HeyCatchCapturedEvent, c as HeyCatchPersistence, f as HeyCatchSanitizeProperties, K as KNOWN_FRAMEWORKS, g as KNOWN_INSTALL_AGENTS, P as PersonPropertyUpdate, S as SDK_VERSION, h as STAGE, i as ServerTrackOptions, U as UNKNOWN_INSTALL_VALUE } from './shared-CaIZ-Tgs.cjs';
|
|
41
3
|
|
|
42
4
|
/**
|
|
43
|
-
*
|
|
5
|
+
* Starts capturing after `optOutCapturingByDefault` gated `init()` from
|
|
6
|
+
* sending anything - the consent-gate alternative to skipping `init()`
|
|
7
|
+
* entirely (the "don't call init" workaround this replaces for customers
|
|
8
|
+
* under GDPR/CookieYes-style consent banners). Call once consent is
|
|
9
|
+
* granted.
|
|
10
|
+
*
|
|
11
|
+
* Also releases the browser-storage half of the gate, since `init()` pairs
|
|
12
|
+
* `opt_out_persistence_by_default` with the capture opt-out.
|
|
44
13
|
*
|
|
45
|
-
*
|
|
46
|
-
* rendered in a dashboard, so a nested object or a function would either be
|
|
47
|
-
* dropped upstream or arrive as `[object Object]`. Restricting the type puts
|
|
48
|
-
* that failure at the call site, in the customer's editor.
|
|
14
|
+
* Warns and does nothing before `init()` - see the note above.
|
|
49
15
|
*/
|
|
50
|
-
|
|
16
|
+
declare function optInCapturing(): void;
|
|
51
17
|
/**
|
|
52
|
-
*
|
|
18
|
+
* Stops capturing again, for a visitor who WITHDRAWS consent - the other
|
|
19
|
+
* half of a consent banner, and the only one that can act on the current
|
|
20
|
+
* pageload (not loading the SDK next time cannot un-capture this one).
|
|
53
21
|
*
|
|
54
|
-
*
|
|
55
|
-
* `last_seen_at`).
|
|
56
|
-
* - `setOnce` writes only if the person does not already have the key - use for
|
|
57
|
-
* values that describe the beginning and must not be overwritten by a later
|
|
58
|
-
* visit (`signup_date`, `initial_referrer`).
|
|
59
|
-
*
|
|
60
|
-
* Named `set` / `setOnce` rather than the transport's own `$set` / `$set_once`:
|
|
61
|
-
* the `$` names are an implementation detail of who we send to, and this is a
|
|
62
|
-
* published customer-facing API that must not change if that ever does.
|
|
22
|
+
* Warns and does nothing before `init()` - see the note above.
|
|
63
23
|
*/
|
|
64
|
-
|
|
65
|
-
set?: HeyCatchProperties;
|
|
66
|
-
setOnce?: HeyCatchProperties;
|
|
67
|
-
}
|
|
24
|
+
declare function optOutCapturing(): void;
|
|
68
25
|
|
|
69
26
|
/**
|
|
70
27
|
* Link the anonymous visitor to your authenticated user. Call once
|
|
@@ -82,28 +39,20 @@ interface PersonPropertyUpdate {
|
|
|
82
39
|
* those as regular properties would reset them on every login.
|
|
83
40
|
*
|
|
84
41
|
* @example
|
|
85
|
-
*
|
|
42
|
+
* setIdentity(user.id,
|
|
86
43
|
* { email: user.email, plan: 'pro' },
|
|
87
44
|
* { signup_date: user.createdAt },
|
|
88
45
|
* );
|
|
89
46
|
*/
|
|
90
|
-
declare function
|
|
47
|
+
declare function setIdentity(userId: string, properties?: HeyCatchPersonProperties, propertiesOnce?: HeyCatchPersonProperties): void;
|
|
91
48
|
/**
|
|
92
49
|
* Clear the current identity. Call on sign-out so the next visitor on
|
|
93
50
|
* this browser starts anonymous.
|
|
94
51
|
*/
|
|
95
|
-
declare function
|
|
52
|
+
declare function resetIdentity(): void;
|
|
53
|
+
|
|
54
|
+
declare function init(config: HeyCatchConfig): void;
|
|
96
55
|
|
|
97
|
-
interface TrackOptions extends PersonPropertyUpdate {
|
|
98
|
-
/**
|
|
99
|
-
* Send this event immediately instead of batching it.
|
|
100
|
-
*
|
|
101
|
-
* Only worth setting when the page is about to unload - a sign-up redirect,
|
|
102
|
-
* a checkout hand-off - where a batched event would be lost. It costs a
|
|
103
|
-
* request per event, so it is not the default.
|
|
104
|
-
*/
|
|
105
|
-
sendInstantly?: boolean;
|
|
106
|
-
}
|
|
107
56
|
/**
|
|
108
57
|
* Record a product event.
|
|
109
58
|
*
|
|
@@ -123,7 +72,7 @@ interface TrackOptions extends PersonPropertyUpdate {
|
|
|
123
72
|
*
|
|
124
73
|
* No-op before `init()` or on the server.
|
|
125
74
|
*/
|
|
126
|
-
declare function
|
|
75
|
+
declare function trackEvent(event: string, properties?: HeyCatchProperties, options?: TrackOptions): void;
|
|
127
76
|
/**
|
|
128
77
|
* Update the current person's properties without sending a product event, and
|
|
129
78
|
* without changing who they are.
|
|
@@ -137,6 +86,24 @@ declare function track(event: string, properties?: HeyCatchProperties, options?:
|
|
|
137
86
|
*
|
|
138
87
|
* No-op before `init()` or on the server.
|
|
139
88
|
*/
|
|
140
|
-
declare function setPersonProperties(set?:
|
|
89
|
+
declare function setPersonProperties(set?: HeyCatchPersonProperties, setOnce?: HeyCatchPersonProperties): void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The analytics surface, as one namespace. The package is HeyCatch's
|
|
93
|
+
* product SDK - analytics is its first capability, not its identity - so
|
|
94
|
+
* the API ships as `analytics.*` and a future capability arrives as a
|
|
95
|
+
* sibling namespace instead of more loose top-level functions. The server
|
|
96
|
+
* entry exports the same-shaped object, which is what keeps isomorphic
|
|
97
|
+
* code resolving under every `exports` condition.
|
|
98
|
+
*/
|
|
99
|
+
declare const analytics: {
|
|
100
|
+
readonly init: typeof init;
|
|
101
|
+
readonly optInCapturing: typeof optInCapturing;
|
|
102
|
+
readonly optOutCapturing: typeof optOutCapturing;
|
|
103
|
+
readonly resetIdentity: typeof resetIdentity;
|
|
104
|
+
readonly setIdentity: typeof setIdentity;
|
|
105
|
+
readonly setPersonProperties: typeof setPersonProperties;
|
|
106
|
+
readonly trackEvent: typeof trackEvent;
|
|
107
|
+
};
|
|
141
108
|
|
|
142
|
-
export {
|
|
109
|
+
export { HeyCatchConfig, HeyCatchPersonProperties, HeyCatchProperties, TrackOptions, analytics };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,70 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* runtime array: `apps/landing-web/tests/agent-install-guides.spec.ts`
|
|
4
|
-
* reads this source text and asserts the set matches the guides' tables,
|
|
5
|
-
* so docs, types, and reported values cannot drift.
|
|
6
|
-
*/
|
|
7
|
-
type KnownFramework = 'nextjs' | 'vite-react' | 'react' | 'vue' | 'svelte' | 'astro' | 'angular' | 'web';
|
|
8
|
-
/** Coding agents that run the install. `other` is the catch-all. */
|
|
9
|
-
type KnownInstallAgent = 'lovable' | 'bolt' | 'v0' | 'replit' | 'cursor' | 'claude-code' | 'codex' | 'windsurf' | 'other';
|
|
10
|
-
/**
|
|
11
|
-
* Who installed the SDK and into what. Stamped as super-properties on
|
|
12
|
-
* every event - the dashboard reads them off the event stream, so there
|
|
13
|
-
* is no separate install call to make or to fail.
|
|
14
|
-
*
|
|
15
|
-
* `(string & {})` keeps the known ids as editor completions while still
|
|
16
|
-
* accepting anything: a framework we haven't listed yet must not block
|
|
17
|
-
* an install.
|
|
18
|
-
*/
|
|
19
|
-
interface HeyCatchInstall {
|
|
20
|
-
/** Framework id from the install guide, e.g. `nextjs`. */
|
|
21
|
-
framework?: KnownFramework | (string & {});
|
|
22
|
-
/** That framework's major version, e.g. `15`. */
|
|
23
|
-
frameworkVersion?: string;
|
|
24
|
-
/** The agent doing the install, e.g. `claude-code`. */
|
|
25
|
-
agent?: KnownInstallAgent | (string & {});
|
|
26
|
-
}
|
|
27
|
-
/** Configuration for {@link init}. */
|
|
28
|
-
interface HeyCatchConfig {
|
|
29
|
-
/** Your project's publishable key (`hck_pk_...`). */
|
|
30
|
-
projectKey: string;
|
|
31
|
-
/** Install metadata, stamped on every event. Omit any field you can't determine. */
|
|
32
|
-
install?: HeyCatchInstall;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Initialize HeyCatch. Call once at the client-side entry point -
|
|
37
|
-
* autocapture starts immediately, nothing else to instrument.
|
|
38
|
-
* Idempotent and a safe no-op on the server.
|
|
39
|
-
*/
|
|
40
|
-
declare function init(config: HeyCatchConfig): void;
|
|
1
|
+
import { d as HeyCatchPersonProperties, b as HeyCatchConfig, e as HeyCatchProperties, T as TrackOptions } from './shared-CaIZ-Tgs.js';
|
|
2
|
+
export { H as HeyCatchBeforeSend, a as HeyCatchCapturedEvent, c as HeyCatchPersistence, f as HeyCatchSanitizeProperties, K as KNOWN_FRAMEWORKS, g as KNOWN_INSTALL_AGENTS, P as PersonPropertyUpdate, S as SDK_VERSION, h as STAGE, i as ServerTrackOptions, U as UNKNOWN_INSTALL_VALUE } from './shared-CaIZ-Tgs.js';
|
|
41
3
|
|
|
42
4
|
/**
|
|
43
|
-
*
|
|
5
|
+
* Starts capturing after `optOutCapturingByDefault` gated `init()` from
|
|
6
|
+
* sending anything - the consent-gate alternative to skipping `init()`
|
|
7
|
+
* entirely (the "don't call init" workaround this replaces for customers
|
|
8
|
+
* under GDPR/CookieYes-style consent banners). Call once consent is
|
|
9
|
+
* granted.
|
|
10
|
+
*
|
|
11
|
+
* Also releases the browser-storage half of the gate, since `init()` pairs
|
|
12
|
+
* `opt_out_persistence_by_default` with the capture opt-out.
|
|
44
13
|
*
|
|
45
|
-
*
|
|
46
|
-
* rendered in a dashboard, so a nested object or a function would either be
|
|
47
|
-
* dropped upstream or arrive as `[object Object]`. Restricting the type puts
|
|
48
|
-
* that failure at the call site, in the customer's editor.
|
|
14
|
+
* Warns and does nothing before `init()` - see the note above.
|
|
49
15
|
*/
|
|
50
|
-
|
|
16
|
+
declare function optInCapturing(): void;
|
|
51
17
|
/**
|
|
52
|
-
*
|
|
18
|
+
* Stops capturing again, for a visitor who WITHDRAWS consent - the other
|
|
19
|
+
* half of a consent banner, and the only one that can act on the current
|
|
20
|
+
* pageload (not loading the SDK next time cannot un-capture this one).
|
|
53
21
|
*
|
|
54
|
-
*
|
|
55
|
-
* `last_seen_at`).
|
|
56
|
-
* - `setOnce` writes only if the person does not already have the key - use for
|
|
57
|
-
* values that describe the beginning and must not be overwritten by a later
|
|
58
|
-
* visit (`signup_date`, `initial_referrer`).
|
|
59
|
-
*
|
|
60
|
-
* Named `set` / `setOnce` rather than the transport's own `$set` / `$set_once`:
|
|
61
|
-
* the `$` names are an implementation detail of who we send to, and this is a
|
|
62
|
-
* published customer-facing API that must not change if that ever does.
|
|
22
|
+
* Warns and does nothing before `init()` - see the note above.
|
|
63
23
|
*/
|
|
64
|
-
|
|
65
|
-
set?: HeyCatchProperties;
|
|
66
|
-
setOnce?: HeyCatchProperties;
|
|
67
|
-
}
|
|
24
|
+
declare function optOutCapturing(): void;
|
|
68
25
|
|
|
69
26
|
/**
|
|
70
27
|
* Link the anonymous visitor to your authenticated user. Call once
|
|
@@ -82,28 +39,20 @@ interface PersonPropertyUpdate {
|
|
|
82
39
|
* those as regular properties would reset them on every login.
|
|
83
40
|
*
|
|
84
41
|
* @example
|
|
85
|
-
*
|
|
42
|
+
* setIdentity(user.id,
|
|
86
43
|
* { email: user.email, plan: 'pro' },
|
|
87
44
|
* { signup_date: user.createdAt },
|
|
88
45
|
* );
|
|
89
46
|
*/
|
|
90
|
-
declare function
|
|
47
|
+
declare function setIdentity(userId: string, properties?: HeyCatchPersonProperties, propertiesOnce?: HeyCatchPersonProperties): void;
|
|
91
48
|
/**
|
|
92
49
|
* Clear the current identity. Call on sign-out so the next visitor on
|
|
93
50
|
* this browser starts anonymous.
|
|
94
51
|
*/
|
|
95
|
-
declare function
|
|
52
|
+
declare function resetIdentity(): void;
|
|
53
|
+
|
|
54
|
+
declare function init(config: HeyCatchConfig): void;
|
|
96
55
|
|
|
97
|
-
interface TrackOptions extends PersonPropertyUpdate {
|
|
98
|
-
/**
|
|
99
|
-
* Send this event immediately instead of batching it.
|
|
100
|
-
*
|
|
101
|
-
* Only worth setting when the page is about to unload - a sign-up redirect,
|
|
102
|
-
* a checkout hand-off - where a batched event would be lost. It costs a
|
|
103
|
-
* request per event, so it is not the default.
|
|
104
|
-
*/
|
|
105
|
-
sendInstantly?: boolean;
|
|
106
|
-
}
|
|
107
56
|
/**
|
|
108
57
|
* Record a product event.
|
|
109
58
|
*
|
|
@@ -123,7 +72,7 @@ interface TrackOptions extends PersonPropertyUpdate {
|
|
|
123
72
|
*
|
|
124
73
|
* No-op before `init()` or on the server.
|
|
125
74
|
*/
|
|
126
|
-
declare function
|
|
75
|
+
declare function trackEvent(event: string, properties?: HeyCatchProperties, options?: TrackOptions): void;
|
|
127
76
|
/**
|
|
128
77
|
* Update the current person's properties without sending a product event, and
|
|
129
78
|
* without changing who they are.
|
|
@@ -137,6 +86,24 @@ declare function track(event: string, properties?: HeyCatchProperties, options?:
|
|
|
137
86
|
*
|
|
138
87
|
* No-op before `init()` or on the server.
|
|
139
88
|
*/
|
|
140
|
-
declare function setPersonProperties(set?:
|
|
89
|
+
declare function setPersonProperties(set?: HeyCatchPersonProperties, setOnce?: HeyCatchPersonProperties): void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The analytics surface, as one namespace. The package is HeyCatch's
|
|
93
|
+
* product SDK - analytics is its first capability, not its identity - so
|
|
94
|
+
* the API ships as `analytics.*` and a future capability arrives as a
|
|
95
|
+
* sibling namespace instead of more loose top-level functions. The server
|
|
96
|
+
* entry exports the same-shaped object, which is what keeps isomorphic
|
|
97
|
+
* code resolving under every `exports` condition.
|
|
98
|
+
*/
|
|
99
|
+
declare const analytics: {
|
|
100
|
+
readonly init: typeof init;
|
|
101
|
+
readonly optInCapturing: typeof optInCapturing;
|
|
102
|
+
readonly optOutCapturing: typeof optOutCapturing;
|
|
103
|
+
readonly resetIdentity: typeof resetIdentity;
|
|
104
|
+
readonly setIdentity: typeof setIdentity;
|
|
105
|
+
readonly setPersonProperties: typeof setPersonProperties;
|
|
106
|
+
readonly trackEvent: typeof trackEvent;
|
|
107
|
+
};
|
|
141
108
|
|
|
142
|
-
export {
|
|
109
|
+
export { HeyCatchConfig, HeyCatchPersonProperties, HeyCatchProperties, TrackOptions, analytics };
|