Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/platforms/unreal/configuration/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,19 @@ All Sentry SDKs support the <PlatformIdentifier name="before-send" /> callback m
<PlatformContent includePath="configuration/before-send/" />

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 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`.

<Alert>

`beforeSendFeedback` is currently not supported on macOS and iOS.

</Alert>

<PlatformContent includePath="configuration/before-send-feedback/" />
36 changes: 36 additions & 0 deletions platform-includes/configuration/before-send-feedback/unreal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```cpp
UCLASS()
class USomeBeforeSendFeedbackHandler : public USentryBeforeSendFeedbackHandler
{
GENERATED_BODY()

public:
virtual USentryEvent* HandleBeforeSendFeedback_Implementation(USentryEvent* Event, USentryHint* Hint) override
{
// 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);
}
};

...

FConfigureSettingsDelegate SettingsDelegate;
SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate);

void USomeClass::HandleSettingsDelegate(USentrySettings* Settings)
{
Settings->BeforeSendFeedbackHandler = USomeBeforeSendFeedbackHandler::StaticClass();
}

...

USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();

SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
Loading