Blazor WebAssembly
Learn about Sentry's .NET integration with Blazor WebAssembly.
Sentry provides an integration with Blazor WebAssembly through the Sentry.AspNetCore.Blazor.WebAssembly NuGet package.
The Blazor WebAssembly package is currently in alpha preview. Alpha features are still in progress and may have bugs. We recognize the irony.
Add the Sentry dependency to your Blazor WebAssembly application:
Copied
dotnet add package Sentry.AspNetCore.Blazor.WebAssembly -v 4.8.0-preview.1
This package extends Sentry.Extensions.Logging. This means that in addition to the related Blazor WebAssembly features, you'll also get access to the ILogger<T>
integration and other features available in the main Sentry SDK through this package.
Sentry integration with Blazor WebAssembly is done by calling .UseSentry()
and specifying the options, for example:
Copied
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.UseSentry(options =>
{
options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
options.EnableTracing = true;
// When configuring for the first time, to see what the SDK is doing:
// options.Debug = true;
});
// Captures logError and higher as events
builder.Logging.AddSentry(o => o.InitializeSdk = false);
await builder.Build().RunAsync();
- This integration with Blazor WebAssembly sample demonstrates using Sentry with Blazor WebAssembly. (C#)
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").
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").