Unreal Engine

Unreal Engine SDK builds on top of other Sentry SDKs and extends them with Unreal Engine specific features. It gives developers helpful hints for where and why an error or performance issue might have occurred.

Features:

  • Native support for automatic crash error tracking for
  • Android by using the Android SDK to support Java, Kotlin, C and C++
  • iOS by using the iOS SDK to support Objective-C, Swift, C and C++
  • Windows (UE 5.2+) and Linux by using the Native SDK to support C and C++ with minidumps
  • macOS by using the macOS SDK to support Objective-C, Swift, C and C++
  • Compatible with Crash Reporter Client provided along with Unreal Engine
  • Release health to keep track of crash free users and sessions

On this page, we get you up and running with Sentry's SDK.

Don't already have an account and Sentry project established? Head over to sentry.io, then return to this page.

Sentry captures data by using an SDK within your application’s runtime.

The Unreal Engine (UE) SDK is officially supported for the three latest UE versions. However, it is likely to be compatible with older engine versions as well depending on the specific features and functionality that you need.

There are three common ways to install an SDK to use with Unreal Engine:

  1. Install from the Epic Games Fab (formerly known as the marketplace)
  2. Download a pre-built SDK that you install (for example, from a GitHub Releases page)
  3. Clone and build the SDK yourself and install

While you can use any of the three methods to install Sentry, each has its own limitations, as described below.

The table below highlights some key differences between different versions of the SDK:

FeatureGitHub Releases*FabBuild Yourself
Supported engine versions4.27 and newer5.1 and newer4.27 and newer
Supported UE project typesC++ onlyBlueprint and C++C++ only
Backend (Windows)CrashpadBreakpadCrashpad
on_crash hook (Windows)SupportedNot supportedSupported
Sentry CLI **IncludedManual downloadIncluded

Legend:
*: Recommended version of the SDK
**: Sentry CLI is a standalone tool that the plugin uses under the hood to automatically upload debug information files upon game build completion.

The GitHub Releases page provides two plugin packages: github and marketplace. The key difference between the two is the crash capturing backend, which is used under the hood on Windows.

We recommend using the github version, because it uses Crashpad, an out-of-proc handler that sends the crash report right away. The marketplace version relies on Breakpad, an in-proc handler which requires the UE application or game to be relaunched before any crash reports can be sent to Sentry.

To install the SDK, download the most up-to-date sources from the Releases page and add them to your project's Plugins directory. On the next project launch, UE will prompt you to build the Sentry and SentryEditor modules.

Currently, this method is available only for C++ UE projects. Blueprint projects can be converted to a C++ one by adding an empty class using the editor.

Sentry SDK can be downloaded via the standard installation process from its Epic Games Fab page.

This method is recommended only for Blueprint UE projects. If you already have a C++ UE project or don't mind converting an existing Blueprint UE project to a C++ one, consider downloading the plugin from GitHub instead.

To get started, we recommend cloning the Unreal SDK repository and running the initialization script:

  • ./scripts/init.sh on macOS/Linux
  • ./scripts/init-win.ps1 on Windows

Initialization scripts require GitHub CLI to be installed.

If the initialization script fails due to errors on Windows, check your PowerShell version by printing the built-in variable $PSVersionTable. If the version is 5.x, upgrading to a newer version of PowerShell may resolve these errors.

This script links the checked out version of the plugin (the plugin-dev directory) to the sample app and downloads the latest builds of native SDKs from our GitHub CI.

After successful initialization, copy the contents of the plugin-dev directory to <your_project_root>/Plugins/Sentry. This will allow you to use Sentry in your Unreal Engine project.

To make sure the Sentry plugin has been enabled after installation has been completed, go to the editor and navigate to the Settings > Plugins > Code Plugins menu and check for the installation.

Sentry window

To access the plugin API from within C++, add Sentry support to the build script (MyProject.build.cs):

Copied
PublicDependencyModuleNames.AddRange(new string[] { ..., "Sentry" });

The minimum configuration required is the DSN of your project:

Copied
{
  "public-dsn": "https://examplePublicKey@o0.ingest.sentry.io/0"
}

If you are logged in, you can also go to your project settings and copy its DSN directly from there.

Sentry can be configured using the Sentry configuration window. The window can be accessed by going to editor's menu: Project Settings > Plugins > Sentry.

Sentry settings window

By default, the SDK is automatically initialized on application startup. Alternatively, the Initialize SDK automatically option can be disabled and in this case, explicit SDK initialization is required.

To override SDK settings at runtime, use the InitializeWithSettings method of the SentrySubsystem class.

This snippet includes message capturing, so you can test that everything is working as soon as you set it up:

Copied
#include "SentrySubsystem.h"

void Verify()
{
    // Capture message
    USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem>();
    SentrySubsystem->CaptureMessage(TEXT("Capture message"));
}

The same result can be achieved by calling corresponding function in blueprint:

Sentry capture message BP

Learn more about manually capturing an error or message in our Usage documentation.

To view and resolve the recorded error, log into sentry.io and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").