Skip to content

Unreal Engine: Remove ConfigureScope function #13872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
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
32 changes: 3 additions & 29 deletions docs/platforms/unreal/enriching-events/scopes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,16 @@ routes or controllers.
As you start using an SDK, a scope and hub are automatically created for you out
of the box. It's unlikely that you'll interact with the hub directly unless you're
writing an integration or you want to create or destroy scopes. Scopes, on the
other hand are more user facing. You can call <PlatformIdentifier name="configure-scope" /> at any point in
time to modify data stored on the scope. This is useful for doing things like
[modifying the context](../context/).
other hand are more user facing. You can modify data stored on the scope at any point.
This is useful for doing things like [modifying the context](../context/).

When you call a global function such as <PlatformIdentifier name="capture-event" /> internally Sentry
discovers the current hub and asks it to capture an event. Internally the hub will
then merge the event with the topmost scope's data.

## Configuring the Scope

The most useful operation when working with scopes is the <PlatformIdentifier name="configure-scope" /> function. It can be used to reconfigure the current scope.

You can, for instance, add custom tags or inform Sentry about the currently authenticated user.

```cpp
FConfigureScopeDelegate ScopeDelegate;
ScopeDelegate.BindDynamic(this, &USomeClass::HandleScopeDelegate);

void USomeClass::HandleScopeDelegate(USentryScope* Scope)
{
USentryUser* SentryUser = NewObject<USentryUser>();
SentryUser->SetEmail("[email protected]");
SentryUser->SetId(42);

Scope->SetUser(SentryUser);
Scope->SetTagValue("my-tag", "my value");
}

...

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

SentrySubsystem->ConfigureScope(ScopeDelegate);
```

Alternatively, all data can be configured on the global scope using dedicated methods of `SentrySubsystem` class.
All data can be configured on the global scope using dedicated methods of `SentrySubsystem` class.

```cpp
USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
Expand Down