@heycatch/sdk 0.7.0 → 0.7.1-dev.1456
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 +82 -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-B8y8fJCD.d.cts → shared-BFhHwsG8.d.cts} +116 -5
- package/dist/{shared-B8y8fJCD.d.ts → shared-BFhHwsG8.d.ts} +116 -5
- package/package.json +4 -1
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { P as PersonPropertyUpdate, S as SDK_VERSION,
|
|
1
|
+
import { d as HeyCatchPersonProperties, b as HeyCatchConfig, e as HeyCatchProperties, i as ServerTrackOptions } from './shared-BFhHwsG8.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, U as UNKNOWN_INSTALL_VALUE } from './shared-BFhHwsG8.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The consent pair, present on the server namespace so the `analytics`
|
|
6
|
+
* object has the SAME shape under every `exports` condition - the
|
|
7
|
+
* invariant that lets isomorphic code call `analytics.optInCapturing()`
|
|
8
|
+
* from a file the bundler resolves for the browser and `tsc` resolves for
|
|
9
|
+
* Node. Omitting them here is what broke that: the call typechecked in the
|
|
10
|
+
* browser and failed under the `node` condition.
|
|
11
|
+
*
|
|
12
|
+
* Both are deliberate no-ops rather than a thrown error or a console
|
|
13
|
+
* warning. A server has no consent state to gate: there is no ambient
|
|
14
|
+
* person and no browser storage, every server write already names its
|
|
15
|
+
* `userId` explicitly, and it only happens because the app chose to call
|
|
16
|
+
* it. A warning would fire on every isomorphic boot and teach customers to
|
|
17
|
+
* ignore our console output.
|
|
18
|
+
*/
|
|
19
|
+
/** No-op on the server. See the note above. */
|
|
20
|
+
declare function optInCapturing(): void;
|
|
21
|
+
/** No-op on the server. See the note above. */
|
|
22
|
+
declare function optOutCapturing(): void;
|
|
3
23
|
|
|
4
24
|
/**
|
|
5
25
|
* Update a user's person properties from the server - a payment webhook, a
|
|
@@ -30,7 +50,12 @@ declare function resetIdentity(): void;
|
|
|
30
50
|
* Initialize the server entry. Call once at module scope; idempotent.
|
|
31
51
|
* Takes the same config shape as the browser `init` - `install` metadata
|
|
32
52
|
* is accepted for symmetry but not stamped: install facts describe the
|
|
33
|
-
* client app, and the events they ride on are client events.
|
|
53
|
+
* client app, and the events they ride on are client events. Same for the
|
|
54
|
+
* privacy passthrough fields (`autocapture`, `maskAllText`, `persistence`,
|
|
55
|
+
* …, see `shared.ts`): they parse cleanly here, so one `HeyCatchConfig`
|
|
56
|
+
* object works under every `exports` condition, but none is read - a
|
|
57
|
+
* server has no DOM to autocapture from and no browser storage to gate.
|
|
58
|
+
* Deliberate, not a gap: only the web entry applies them.
|
|
34
59
|
*/
|
|
35
60
|
declare function init(config: HeyCatchConfig): void;
|
|
36
61
|
|
|
@@ -69,6 +94,8 @@ declare function trackEvent(event: string, properties: HeyCatchProperties | unde
|
|
|
69
94
|
*/
|
|
70
95
|
declare const analytics: {
|
|
71
96
|
readonly init: typeof init;
|
|
97
|
+
readonly optInCapturing: typeof optInCapturing;
|
|
98
|
+
readonly optOutCapturing: typeof optOutCapturing;
|
|
72
99
|
readonly resetIdentity: typeof resetIdentity;
|
|
73
100
|
readonly setIdentity: typeof setIdentity;
|
|
74
101
|
readonly setPersonProperties: typeof setPersonProperties;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { P as PersonPropertyUpdate, S as SDK_VERSION,
|
|
1
|
+
import { d as HeyCatchPersonProperties, b as HeyCatchConfig, e as HeyCatchProperties, i as ServerTrackOptions } from './shared-BFhHwsG8.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, U as UNKNOWN_INSTALL_VALUE } from './shared-BFhHwsG8.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The consent pair, present on the server namespace so the `analytics`
|
|
6
|
+
* object has the SAME shape under every `exports` condition - the
|
|
7
|
+
* invariant that lets isomorphic code call `analytics.optInCapturing()`
|
|
8
|
+
* from a file the bundler resolves for the browser and `tsc` resolves for
|
|
9
|
+
* Node. Omitting them here is what broke that: the call typechecked in the
|
|
10
|
+
* browser and failed under the `node` condition.
|
|
11
|
+
*
|
|
12
|
+
* Both are deliberate no-ops rather than a thrown error or a console
|
|
13
|
+
* warning. A server has no consent state to gate: there is no ambient
|
|
14
|
+
* person and no browser storage, every server write already names its
|
|
15
|
+
* `userId` explicitly, and it only happens because the app chose to call
|
|
16
|
+
* it. A warning would fire on every isomorphic boot and teach customers to
|
|
17
|
+
* ignore our console output.
|
|
18
|
+
*/
|
|
19
|
+
/** No-op on the server. See the note above. */
|
|
20
|
+
declare function optInCapturing(): void;
|
|
21
|
+
/** No-op on the server. See the note above. */
|
|
22
|
+
declare function optOutCapturing(): void;
|
|
3
23
|
|
|
4
24
|
/**
|
|
5
25
|
* Update a user's person properties from the server - a payment webhook, a
|
|
@@ -30,7 +50,12 @@ declare function resetIdentity(): void;
|
|
|
30
50
|
* Initialize the server entry. Call once at module scope; idempotent.
|
|
31
51
|
* Takes the same config shape as the browser `init` - `install` metadata
|
|
32
52
|
* is accepted for symmetry but not stamped: install facts describe the
|
|
33
|
-
* client app, and the events they ride on are client events.
|
|
53
|
+
* client app, and the events they ride on are client events. Same for the
|
|
54
|
+
* privacy passthrough fields (`autocapture`, `maskAllText`, `persistence`,
|
|
55
|
+
* …, see `shared.ts`): they parse cleanly here, so one `HeyCatchConfig`
|
|
56
|
+
* object works under every `exports` condition, but none is read - a
|
|
57
|
+
* server has no DOM to autocapture from and no browser storage to gate.
|
|
58
|
+
* Deliberate, not a gap: only the web entry applies them.
|
|
34
59
|
*/
|
|
35
60
|
declare function init(config: HeyCatchConfig): void;
|
|
36
61
|
|
|
@@ -69,6 +94,8 @@ declare function trackEvent(event: string, properties: HeyCatchProperties | unde
|
|
|
69
94
|
*/
|
|
70
95
|
declare const analytics: {
|
|
71
96
|
readonly init: typeof init;
|
|
97
|
+
readonly optInCapturing: typeof optInCapturing;
|
|
98
|
+
readonly optOutCapturing: typeof optOutCapturing;
|
|
72
99
|
readonly resetIdentity: typeof resetIdentity;
|
|
73
100
|
readonly setIdentity: typeof setIdentity;
|
|
74
101
|
readonly setPersonProperties: typeof setPersonProperties;
|