From 8c4961b54d242cddf64cce5128cc21c20db46280 Mon Sep 17 00:00:00 2001 From: Ioannis J Date: Tue, 26 Nov 2024 13:11:26 +0200 Subject: [PATCH] feat: add new iOS session replay configuration (#317) * feat: add new iOS session replay configuration * fix: assign config * fix: format * chore: prepare release --- posthog-react-native/CHANGELOG.md | 14 ++++++++++++++ posthog-react-native/package.json | 2 +- posthog-react-native/src/posthog-rn.ts | 4 ++++ posthog-react-native/src/types.ts | 15 +++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/posthog-react-native/CHANGELOG.md b/posthog-react-native/CHANGELOG.md index b3051fac..fcc7d342 100644 --- a/posthog-react-native/CHANGELOG.md +++ b/posthog-react-native/CHANGELOG.md @@ -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 diff --git a/posthog-react-native/package.json b/posthog-react-native/package.json index d0b21f09..f76b3e65 100644 --- a/posthog-react-native/package.json +++ b/posthog-react-native/package.json @@ -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/" diff --git a/posthog-react-native/src/posthog-rn.ts b/posthog-react-native/src/posthog-rn.ts index f4de3ce9..7770b7a7 100644 --- a/posthog-react-native/src/posthog-rn.ts +++ b/posthog-react-native/src/posthog-rn.ts @@ -300,6 +300,8 @@ export class PostHog extends PostHogCore { const { maskAllTextInputs = true, maskAllImages = true, + maskAllSandboxedViews = true, + maskPhotoLibraryImages = true, captureLog = true, captureNetworkTelemetry = true, iOSdebouncerDelayMs = 1000, @@ -309,6 +311,8 @@ export class PostHog extends PostHogCore { const sdkReplayConfig = { maskAllTextInputs, maskAllImages, + maskAllSandboxedViews, + maskPhotoLibraryImages, captureLog, captureNetworkTelemetry, iOSdebouncerDelayMs, diff --git a/posthog-react-native/src/types.ts b/posthog-react-native/src/types.ts index b37b728f..997ad8f3 100644 --- a/posthog-react-native/src/types.ts +++ b/posthog-react-native/src/types.ts @@ -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