From 4d0fd72a6259bc207970e1d4303213447bad8d55 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Tue, 11 Aug 2026 12:18:20 +0300 Subject: [PATCH 1/3] Document beforeSendFeedback for Unreal Add a "Filtering User Feedback" section to the Unreal filtering guide and a platform-include showing how to subclass USentryBeforeSendFeedbackHandler and register it via the settings delegate. --- .../unreal/configuration/filtering.mdx | 10 +++++++ .../before-send-feedback/unreal.mdx | 30 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 platform-includes/configuration/before-send-feedback/unreal.mdx diff --git a/docs/platforms/unreal/configuration/filtering.mdx b/docs/platforms/unreal/configuration/filtering.mdx index 4fc0ee527cf2ec..f055354bd811b1 100644 --- a/docs/platforms/unreal/configuration/filtering.mdx +++ b/docs/platforms/unreal/configuration/filtering.mdx @@ -21,3 +21,13 @@ All Sentry SDKs support the callback m Note also that breadcrumbs can be filtered, as discussed in [our Breadcrumbs documentation](/product/issues/issue-details/breadcrumbs/). + +## Filtering User Feedback + +Configure your SDK to filter user feedback by using the `beforeSendFeedback` callback method. + +### Using `beforeSendFeedback` + +The `beforeSendFeedback` callback is called immediately before user feedback is sent to Sentry. It receives the feedback object as a parameter, which you can use to either modify the feedback's data or drop it completely by returning `null`, based on custom logic and the data available on the feedback. + + diff --git a/platform-includes/configuration/before-send-feedback/unreal.mdx b/platform-includes/configuration/before-send-feedback/unreal.mdx new file mode 100644 index 00000000000000..42a0b7ad244f48 --- /dev/null +++ b/platform-includes/configuration/before-send-feedback/unreal.mdx @@ -0,0 +1,30 @@ +```cpp +UCLASS() +class USomeBeforeSendFeedbackHandler : public USentryBeforeSendFeedbackHandler +{ + GENERATED_BODY() + +public: + virtual USentryFeedback* HandleBeforeSendFeedback_Implementation(USentryFeedback* Feedback, USentryHint* Hint) override + { + UE_LOG(LogTemp, Log, TEXT("Hello from CPP beforeSendFeedback handler")); + return Super::HandleBeforeSendFeedback_Implementation(Feedback, Hint); + } +}; + +... + +FConfigureSettingsDelegate SettingsDelegate; +SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate); + +void USomeClass::HandleSettingsDelegate(USentrySettings* Settings) +{ + Settings->BeforeSendFeedbackHandler = USomeBeforeSendFeedbackHandler::StaticClass(); +} + +... + +USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +SentrySubsystem->InitializeWithSettings(SettingsDelegate); +``` From fded030111f2aa2a2cee5dfe8179793e051de5d4 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Wed, 12 Aug 2026 10:08:43 +0300 Subject: [PATCH 2/3] Update beforeSendFeedback docs for the event-based hook Switch the sample to USentryEvent and note that beforeSendFeedback is currently not supported on macOS and iOS. --- docs/platforms/unreal/configuration/filtering.mdx | 8 +++++++- .../configuration/before-send-feedback/unreal.mdx | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/platforms/unreal/configuration/filtering.mdx b/docs/platforms/unreal/configuration/filtering.mdx index f055354bd811b1..ccefa5c2363f09 100644 --- a/docs/platforms/unreal/configuration/filtering.mdx +++ b/docs/platforms/unreal/configuration/filtering.mdx @@ -28,6 +28,12 @@ Configure your SDK to filter user feedback by using the `beforeSendFeedback` cal ### Using `beforeSendFeedback` -The `beforeSendFeedback` callback is called immediately before user feedback is sent to Sentry. It receives the feedback object as a parameter, which you can use to either modify the feedback's data or drop it completely by returning `null`, based on custom logic and the data available on the feedback. +The `beforeSendFeedback` callback is called immediately before user feedback is sent to Sentry. It receives the feedback event as a parameter, which you can use to modify or enrich the event (for example, adjusting the feedback message, tags, or contexts, or scrubbing sensitive data), or drop it completely by returning `null`. + + + +`beforeSendFeedback` is currently not supported on macOS and iOS. + + diff --git a/platform-includes/configuration/before-send-feedback/unreal.mdx b/platform-includes/configuration/before-send-feedback/unreal.mdx index 42a0b7ad244f48..45e7c1fde50a05 100644 --- a/platform-includes/configuration/before-send-feedback/unreal.mdx +++ b/platform-includes/configuration/before-send-feedback/unreal.mdx @@ -5,10 +5,10 @@ class USomeBeforeSendFeedbackHandler : public USentryBeforeSendFeedbackHandler GENERATED_BODY() public: - virtual USentryFeedback* HandleBeforeSendFeedback_Implementation(USentryFeedback* Feedback, USentryHint* Hint) override + virtual USentryEvent* HandleBeforeSendFeedback_Implementation(USentryEvent* Event, USentryHint* Hint) override { UE_LOG(LogTemp, Log, TEXT("Hello from CPP beforeSendFeedback handler")); - return Super::HandleBeforeSendFeedback_Implementation(Feedback, Hint); + return Super::HandleBeforeSendFeedback_Implementation(Event, Hint); } }; From 4536932ef096e3af28a5e195229c1393fcdbf8a5 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Wed, 12 Aug 2026 11:31:24 +0300 Subject: [PATCH 3/3] Show GetFeedback in the beforeSendFeedback example Demonstrate reaching and scrubbing the feedback through the event's typed GetFeedback accessor. --- .../configuration/before-send-feedback/unreal.mdx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform-includes/configuration/before-send-feedback/unreal.mdx b/platform-includes/configuration/before-send-feedback/unreal.mdx index 45e7c1fde50a05..ed8749f851c220 100644 --- a/platform-includes/configuration/before-send-feedback/unreal.mdx +++ b/platform-includes/configuration/before-send-feedback/unreal.mdx @@ -7,7 +7,13 @@ class USomeBeforeSendFeedbackHandler : public USentryBeforeSendFeedbackHandler public: virtual USentryEvent* HandleBeforeSendFeedback_Implementation(USentryEvent* Event, USentryHint* Hint) override { - UE_LOG(LogTemp, Log, TEXT("Hello from CPP beforeSendFeedback handler")); + // The feedback fields are available through the event + if (USentryFeedback* Feedback = Event->GetFeedback()) + { + // Scrub or modify the feedback before it's sent + Feedback->SetContactEmail(TEXT("redacted@example.com")); + } + return Super::HandleBeforeSendFeedback_Implementation(Event, Hint); } };