@heycatch/sdk 0.8.1-dev.1579 → 0.8.3-dev.1682

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
@@ -18,7 +18,7 @@ analytics.init({
18
18
  maskAllText: true, // strip captured elements' text content
19
19
  maskAllElementAttributes: true, // strip captured elements' attributes
20
20
  propertyDenylist: ['some_property'], // drop specific properties from every event (HeyCatch's own attribution keys can't be denylisted)
21
- beforeSend: event => event, // runs on every event right before it's queued; return null to drop it
21
+ beforeSend: event => event, // runs on every event right before it's queued; return null to drop it (the SDK's own delivery and attribution keys are put back after it)
22
22
  persistence: 'localStorage', // where the distinct id + super properties are stored
23
23
  disablePersistence: false, // disable persistence entirely
24
24
  cookieExpirationDays: 365, // days before the persistence cookie expires
@@ -32,6 +32,20 @@ In the browser, setting `autocapture: false`, `maskAllText: true`, or
32
32
  it costs you in the dashboard. (The other entries ignore these options, so
33
33
  they have nothing to warn about - see the platform notes below.)
34
34
 
35
+ ### URL tokens are redacted
36
+
37
+ Some sign-in flows put the session in the page URL - `#access_token=…` and
38
+ `refresh_token=…` after an OAuth or magic-link callback, `?token=…` or
39
+ `?token_hash=…` in the link itself. The SDK replaces those values with
40
+ `[redacted]` in every event before it leaves the app: every string in an
41
+ event's properties is checked (the page URL, the referrer, the first URL
42
+ stored on a person, your own properties), for the parameter names
43
+ `access_token`, `refresh_token`, `token_hash` and `token`, and for anything
44
+ shaped like a JWT. The parameter name stays, so you can still see which page
45
+ it was. This is always on, has no option, and runs after your `beforeSend`,
46
+ so a hook cannot put a token back. It applies in the browser, in React
47
+ Native, and on the server alike.
48
+
35
49
  ### Consent gate
36
50
 
37
51
  Set `optOutCapturingByDefault: true` to capture nothing until your visitor
@@ -120,6 +134,24 @@ localhost limit does not: a native event has no page host, so there is
120
134
  nothing to tell a simulator from a phone. Server events are not counted at
121
135
  all - each one is a call your own code made.
122
136
 
137
+ ## React Native screen views
138
+
139
+ On Expo Router, `<HeyCatchProvider>` records a screen view each time the
140
+ route changes, named by the path (`/settings`, `/recipe/42`). The route's
141
+ search params ride along as properties, minus anything that could identify
142
+ a person or unlock an account: the `#` fragment, keys such as `email`,
143
+ `code`, `token`, `password`, `passcode`, `secret`, `session`, `otp`,
144
+ `pin`, `auth…` and anything containing `key`, plus any value that looks
145
+ like an email address. Attribution params such as
146
+ `utm_*` and ids are kept.
147
+
148
+ If your app already records screens itself with `analytics.trackScreen`,
149
+ turn the automatic ones off so each screen is not counted twice:
150
+
151
+ ```tsx
152
+ <HeyCatchProvider trackScreens={false}>{children}</HeyCatchProvider>
153
+ ```
154
+
123
155
  ## License
124
156
 
125
157
  MIT