@heycatch/sdk 0.8.0 → 0.8.2-dev.1657
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 +32 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/react-native.cjs +1 -1
- package/dist/react-native.d.cts +263 -5
- package/dist/server.cjs +2 -2
- package/dist/server.js +2 -2
- package/package.json +5 -7
- package/dist/react-native.d.ts +0 -110
- package/dist/react-native.js +0 -2
package/README.md
CHANGED
|
@@ -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
|