@heycatch/sdk 0.7.0-dev.974 → 0.7.1-dev.1123

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 CHANGED
@@ -62,6 +62,31 @@ The remaining options above are browser behaviour. React Native honours
62
62
  does not have. The server entry accepts the same `HeyCatchConfig` so one
63
63
  object works under every import condition, and ignores them.
64
64
 
65
+ ## Delivery options
66
+
67
+ By default the SDK batches captured events for a few seconds before sending
68
+ them, which is right for a single-page app. On a **multi-page site** - one
69
+ where each click is a full page load - a visitor can navigate away inside
70
+ that window, and iOS Safari in particular does not reliably let the batch out
71
+ as the page is torn down. The symptom is mobile pageviews missing from your
72
+ dashboard while desktop looks fine. Two options, both browser-only and both
73
+ unset by default:
74
+
75
+ ```ts
76
+ analytics.init({
77
+ projectKey: 'hck_pk_...',
78
+ requestBatching: false, // send every event as it happens - the fix for multi-page sites
79
+ flushIntervalMs: 250, // or keep batching but shrink the window (250-5000 ms; default 3000)
80
+ });
81
+ ```
82
+
83
+ Set one or the other - with batching off the interval has nothing to act on.
84
+ The cost is one request per captured event, and autocapture is on by default:
85
+ the count follows how much a visitor clicks, not how many pages they open, so a
86
+ busy page sends more requests than a quiet one. `flushIntervalMs: 250` is the
87
+ middle ground - still batched, but a window short enough that a navigation
88
+ rarely lands inside it.
89
+
65
90
  ## License
66
91
 
67
92
  MIT