@guidelytech/react-native 0.12.0 → 0.14.0

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
@@ -76,7 +76,7 @@ tasks).
76
76
 
77
77
  | | |
78
78
  |---|---|
79
- | `useGuidely()` | Client: `identify(id, traits?, account?)`, `setAccount`, `updateTraits`, `reset()`, `track(name, props?)`, `screen(name)`, `startGuide(idOrKey)`, `stopGuide()`, `dismissGuide()`, `openChecklist(key)`, `closeChecklist(key)`, `completeChecklistTask(key, taskId)`, `openResourceCenter()`, `closeResourceCenter()`, `refresh()`, `setConsent()`, `on(event, cb)`, `getGuides()`, `getActiveGuide()`, `getState()` |
79
+ | `useGuidely()` | Client: `identify(id, traits?, account?)`, `setAccount`, `updateTraits`, `reset()`, `track(name, props?)`, `screen(name)`, `startGuide(idOrKey)`, `stopGuide()`, `dismissGuide()`, `openChecklist(key)`, `closeChecklist(key)`, `completeChecklistTask(key, taskId)`, `openResourceCenter()`, `closeResourceCenter()`, `refresh()`, `setConsent()`, `on(event, cb)`, `getGuides()`, `getActiveGuide()`, `getState()`, `startSessionRecording()`, `stopSessionRecording()`, `isRecording()`, `getSessionId()` |
80
80
  | `useGuidelyReady()` | `true` once config is loaded |
81
81
  | `useGuidelyIdentify(id, traits?, account?)` | Identify when the signed-in user changes |
82
82
  | `useGuidelyScreen(name)` | Report a screen view from a component |
@@ -85,13 +85,13 @@ tasks).
85
85
  | `useChecklistProgress(key)`, `useGuideState(key)`, `useActiveGuide()` | Live state |
86
86
  | `<GuidelyTarget id>`, `useGuidelyTarget(id)` | Guide targets |
87
87
  | `<GuidelyScreenScope name>`, `guidelyScreenLayout` | Screen scoping for targets |
88
- | `<GuidelyMask>` | Keeps its children's text out of tap analytics |
88
+ | `<GuidelyMask>` | Keeps its children out of tap-analytics text and session recordings (it sets its own `nativeID`) |
89
89
 
90
90
  Provider props: `projectId`, `apiUrl`, `environment`, `storage`, `user`, `debug`, `analytics`,
91
- `consent` (`granted` / `pending` / `denied`), `appVersion` (for *App version* rules), `theme`,
91
+ `consent` (`granted` / `pending` / `denied`), `appVersion` (overrides the detected version, see below), `theme`,
92
92
  `configRefreshMs`, `onNavigate`, `onError`, `showChecklistLauncher` (default `true`),
93
93
  `showResourceCenterLauncher` (default `false`), `showMessengerLauncher` (default `true`), `insets`,
94
- `launcherOffset` (default 72), `autocapture`, `appBuild`.
94
+ `launcherOffset` (default 72), `autocapture`, `appBuild`, `sessionReplay`.
95
95
 
96
96
  ## Product analytics (autocapture)
97
97
 
@@ -111,7 +111,7 @@ runs when the project turns it on (Settings → Product analytics) and analytics
111
111
  | `rage_click` | 3+ taps within 1 s and 30 pt | the `click` properties of the tapped (or hit) view + `count` |
112
112
  | `heatmap` | Every 40 taps, on screen change and when the app goes to the background | `path?`, `viewportWidth`, `viewportHeight`, `pageHeight`, `platform`, `points` |
113
113
  | `page_leave` | The screen changes or the app goes to the background | `path?`, `screen`, `durationMs`, `scrollDepth: 100`, `platform` |
114
- | `page_view` | `screen()` with a new name; after returning to the foreground with `resumed: true` | `path`, `screen`, `platform` |
114
+ | `page_view` | `screen()` with a new name; after returning to the foreground with `resumed: true` | `path`, `screen`, `platform`, `deviceType`, `os`, `osVersion` |
115
115
  | `app_install` / `app_update` | First launch / a launch with a new `appVersion` or `appBuild` | `appVersion`, `build`, `previousVersion`, `previousBuild` |
116
116
  | `app_open` / `app_background` | Cold start and return to the foreground / background | `coldStart` / `foregroundMs` |
117
117
 
@@ -141,10 +141,18 @@ import { GuidelyMask } from "@guidelytech/react-native";
141
141
  <GuidelyMask><Pressable onPress={showCard}><Text>{cardNumber}</Text></Pressable></GuidelyMask>
142
142
  ```
143
143
 
144
- **App lifecycle.** `app_install` / `app_update` need the `appVersion` prop (e.g.
145
- `Application.nativeApplicationVersion` from `expo-application`; `appBuild` from
146
- `nativeBuildVersion`) and `storage`; the last version is stored per public key. An app that already
147
- had Guidely installed stores its version silently on the first launch with this release.
144
+ **App and OS versions.** The SDK detects them on iOS and Android. The OS version (`18.1`, or `14` on
145
+ Android) comes from React Native and is sent as `osVersion` on `page_view` and as the `osVersion`
146
+ flag attribute. React Native has no API for the app's own version and build, so they are read from
147
+ the first linked native module that knows them: `@guidelytech/react-native-replay`
148
+ (`CFBundleShortVersionString` / `versionName`, `CFBundleVersion` / `versionCode`), then
149
+ `expo-application` (not in Expo Go, which reports its own version), then `react-native-device-info`.
150
+ If none of these is installed, pass `appVersion` / `appBuild`. Passing them also overrides the
151
+ detected values.
152
+
153
+ **App lifecycle.** `app_install` / `app_update` need a known app version (detected or the
154
+ `appVersion` prop) and `storage`. The last version is stored per public key. An app that already had
155
+ Guidely installed stores its version silently on the first launch with this release.
148
156
 
149
157
  **Limitations.** React Native has no public API for "which component is under this point", so
150
158
  element resolution (steps 2 and 3, `tag`, `text`) reads React's internal component tree of the touch
@@ -157,6 +165,44 @@ native-stack headers, some third-party native views) may not reach JavaScript to
157
165
  then not captured. Coordinates are relative to the React Native root view (the window in a
158
166
  full-screen app).
159
167
 
168
+ ## Session replay
169
+
170
+ Records sessions for the dashboard's **Replays** player: masked screenshots (about one a second
171
+ while the screen changes), touches, screen views and Guidely events. Screenshots need native code,
172
+ so they come from a separate package; the SDK itself stays pure JavaScript (and works in Expo Go
173
+ without it).
174
+
175
+ ```bash
176
+ npm install @guidelytech/react-native-replay # then rebuild: expo prebuild / pod install / gradle
177
+ ```
178
+
179
+ ```tsx
180
+ <GuidelyProvider projectId="pk_prod_xxx" sessionReplay={{ enabled: true, maskAllText: true }} …>
181
+ ```
182
+
183
+ Recording needs both this option and *Session replay* turned on in the project settings, plus
184
+ analytics consent; the project's sample rate picks which sessions are recorded, and
185
+ `useGuidely().startSessionRecording()` / `stopSessionRecording()` force a session on or off.
186
+
187
+ **Masking** happens on the device before a frame is encoded. `TextInput`s are always painted over;
188
+ `maskAllText` (or the project's *mask all text* setting) covers every `Text`, `maskAllImages` every
189
+ `Image`, and `<GuidelyMask>` anything inside it. The keyboard is never recorded. Targets named in the
190
+ project's block selectors (`#<guidely id>`) are masked too. `maskAllText` also keeps text out of tap
191
+ analytics. Note that `<GuidelyMask>` hides its content from recordings, so wrap only what is
192
+ sensitive, not the whole app.
193
+
194
+ | Option | Default | |
195
+ |---|---|---|
196
+ | `enabled` | `false` | Record sessions |
197
+ | `maskAllText` | `false` | Paint over all text |
198
+ | `maskAllImages` | `false` | Paint over all images |
199
+ | `captureIntervalMs` | `1000` | Time between screenshots (min 500) |
200
+
201
+ Captures pause while a finger is down, follow 200 ms after it lifts and slow to one every 4 s while
202
+ the screen is idle. Chunks upload every 10 s and when the app goes to the background. iOS draws the
203
+ app's windows; Android uses `PixelCopy` (Android 8.0+), so `SurfaceView` content (some map views)
204
+ records as blank and `FLAG_SECURE` screens as a grey frame.
205
+
160
206
  ## Feature flags
161
207
 
162
208
  Built in, with the same `projectId` — nothing to configure:
@@ -179,7 +225,7 @@ useGuidely().isFeatureEnabled("new-checkout"); // or getFeatureValue / getFeatur
179
225
 
180
226
  Flags evaluate on the device with `id` (user id, else the anonymous id), `anonymousId`, identify
181
227
  traits, `account`, `$audiences`, `screen`, `path`, `platform` (`ios` / `android`), `deviceType`,
182
- `appVersion`, `locale` and `environment`, plus `flagAttributes` from the provider. The last payload
228
+ `appVersion`, `osVersion`, `locale` and `environment`, plus `flagAttributes` from the provider. The last payload
183
229
  is kept in `storage`, so flags work offline from a cold start; they refresh when the app returns to
184
230
  the foreground. Experiment exposures are tracked as `experiment_viewed` events.
185
231