From af6c0eca3ae68ec2631e800e59bc522663b4126b Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Sat, 19 Oct 2024 07:51:05 +0200 Subject: [PATCH] fix: all sdkReplayConfig should have a default value --- posthog-react-native/CHANGELOG.md | 4 ++++ posthog-react-native/package.json | 2 +- posthog-react-native/src/posthog-rn.ts | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/posthog-react-native/CHANGELOG.md b/posthog-react-native/CHANGELOG.md index 9a064bda..5a86bded 100644 --- a/posthog-react-native/CHANGELOG.md +++ b/posthog-react-native/CHANGELOG.md @@ -1,5 +1,9 @@ # Next +# 3.3.6 - 2024-10-19 + +1. fix: all sdkReplayConfig should have a default value + # 3.3.5 - 2024-10-15 1. fix: only tries to read device context from react-native-device-info if expo libs are not available diff --git a/posthog-react-native/package.json b/posthog-react-native/package.json index caf65ce1..b7e526fb 100644 --- a/posthog-react-native/package.json +++ b/posthog-react-native/package.json @@ -1,6 +1,6 @@ { "name": "posthog-react-native", - "version": "3.3.5", + "version": "3.3.6", "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 fc28d2fb..075d953b 100644 --- a/posthog-react-native/src/posthog-rn.ts +++ b/posthog-react-native/src/posthog-rn.ts @@ -278,13 +278,22 @@ export class PostHog extends PostHogCore { return } - const sdkReplayConfig = options?.sessionReplayConfig ?? { - maskAllTextInputs: true, - maskAllImages: true, - captureLog: true, - captureNetworkTelemetry: true, - iOSdebouncerDelayMs: 1000, - androidDebouncerDelayMs: 500, + const { + maskAllTextInputs = true, + maskAllImages = true, + captureLog = true, + captureNetworkTelemetry = true, + iOSdebouncerDelayMs = 1000, + androidDebouncerDelayMs = 500, + } = options?.sessionReplayConfig ?? {} + + const sdkReplayConfig = { + maskAllTextInputs, + maskAllImages, + captureLog, + captureNetworkTelemetry, + iOSdebouncerDelayMs, + androidDebouncerDelayMs, } this.logMsgIfDebug(() =>