Skip to content

Commit

Permalink
feat: add new iOS session replay configuration (#317)
Browse files Browse the repository at this point in the history
* feat: add new iOS session replay configuration

* fix: assign config

* fix: format

* chore: prepare release
  • Loading branch information
ioannisj authored Nov 26, 2024
1 parent f84ce2f commit 8c4961b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
14 changes: 14 additions & 0 deletions posthog-react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Next

# 3.4.0 - 2024-11-26

1. feat: automatically mask out user photos and sandboxed views like photo picker (iOS Only)
1. To disable masking set `maskAllSandboxedViews` and `maskPhotoLibraryImages` to false

```js
export const posthog = new PostHog(
'apiKey...',
sessionReplayConfig: {
maskAllSandboxedViews: false,
maskPhotoLibraryImages: false,
);
```
# 3.3.14 - 2024-11-21
1. fix: identify method allows passing a $set_once object
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthog-react-native",
"version": "3.3.14",
"version": "3.4.0",
"main": "lib/posthog-react-native/index.js",
"files": [
"lib/"
Expand Down
4 changes: 4 additions & 0 deletions posthog-react-native/src/posthog-rn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ export class PostHog extends PostHogCore {
const {
maskAllTextInputs = true,
maskAllImages = true,
maskAllSandboxedViews = true,
maskPhotoLibraryImages = true,
captureLog = true,
captureNetworkTelemetry = true,
iOSdebouncerDelayMs = 1000,
Expand All @@ -309,6 +311,8 @@ export class PostHog extends PostHogCore {
const sdkReplayConfig = {
maskAllTextInputs,
maskAllImages,
maskAllSandboxedViews,
maskPhotoLibraryImages,
captureLog,
captureNetworkTelemetry,
iOSdebouncerDelayMs,
Expand Down
15 changes: 15 additions & 0 deletions posthog-react-native/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ export type PostHogSessionReplayConfig = {
* Default: true
*/
maskAllImages?: boolean
/**
* Enable masking of all sandboxed system views
* These may include UIImagePickerController, PHPickerViewController and CNContactPickerViewController
* iOS only
* Experimental support
* Default: true
*/
maskAllSandboxedViews?: boolean
/**
* Enable masking of images that likely originated from user's photo library
* Experimental support (UIKit only)
* iOS only
* Default: true
*/
maskPhotoLibraryImages?: boolean
/**
* Enable capturing of logcat as console events
* Android only
Expand Down

0 comments on commit 8c4961b

Please sign in to comment.