---
title: "Blazor WebAssembly"
description: "Learn about Sentry's .NET integration with Blazor WebAssembly."
url: https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/
---

# Blazor WebAssembly | Sentry for Blazor WebAssembly

Sentry provides an integration with Blazor WebAssembly through the [Sentry.AspNetCore.Blazor.WebAssembly NuGet package](https://www.nuget.org/packages/Sentry.AspNetCore.Blazor.WebAssembly).

## [Install](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly.md#install)

Error Monitoring\[ ]Tracing

Add the Sentry dependency to your Blazor WebAssembly application:

```shell
dotnet add package Sentry.AspNetCore.Blazor.WebAssembly -v 6.3.1
```

This package extends [Sentry.Extensions.Logging](https://docs.sentry.io/platforms/dotnet/guides/extensions-logging.md). 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](https://docs.sentry.io/platforms/dotnet.md) SDK through this package.

## [Configure](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly.md#configure)

Sentry integration with Blazor WebAssembly is done by calling `.UseSentry()` and specifying the options, for example:

```csharp
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Logging;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.UseSentry(options =>
{
    options.Dsn = "___PUBLIC_DSN___";
    // When configuring for the first time, to see what the SDK is doing:
    options.Debug = true;
    // Adds request URL and headers, IP and name for users, etc.
    options.SendDefaultPii = true;
    // ___PRODUCT_OPTION_START___ performance
    options.TracesSampleRate = 0.1;
    // ___PRODUCT_OPTION_END___ performance
});

// Captures logError and higher as events
builder.Logging.AddSentry(o => o.InitializeSdk = false);

await builder.Build().RunAsync();
```

## [Verify](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly.md#verify)

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

```csharp
try
{
    throw null;
}
catch (Exception ex)
{
    SentrySdk.CaptureException(ex);
}
```

## [Samples](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly.md#samples)

* This [integration with Blazor WebAssembly](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.AspNetCore.Blazor.Wasm) sample demonstrates using Sentry with Blazor WebAssembly. (**C#**)

## [Next Steps](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly.md#next-steps)

* Explore [practical guides](https://docs.sentry.io/guides.md) on what to monitor, log, track, and investigate after setup

## Other .NET Frameworks

- [.NET for Android](https://docs.sentry.io/platforms/dotnet/guides/android.md)
- [.NET for iOS, macOS, and Mac Catalyst](https://docs.sentry.io/platforms/dotnet/guides/apple.md)
- [ASP.NET](https://docs.sentry.io/platforms/dotnet/guides/aspnet.md)
- [ASP.NET Core](https://docs.sentry.io/platforms/dotnet/guides/aspnetcore.md)
- [AWS Lambda](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda.md)
- [Azure Functions](https://docs.sentry.io/platforms/dotnet/guides/azure-functions-worker.md)
- [Entity Framework](https://docs.sentry.io/platforms/dotnet/guides/entityframework.md)
- [Google Cloud Functions](https://docs.sentry.io/platforms/dotnet/guides/google-cloud-functions.md)
- [log4net](https://docs.sentry.io/platforms/dotnet/guides/log4net.md)
- [MAUI](https://docs.sentry.io/platforms/dotnet/guides/maui.md)
- [Microsoft.Extensions.Logging](https://docs.sentry.io/platforms/dotnet/guides/extensions-logging.md)
- [NLog](https://docs.sentry.io/platforms/dotnet/guides/nlog.md)
- [Serilog](https://docs.sentry.io/platforms/dotnet/guides/serilog.md)
- [Windows Forms](https://docs.sentry.io/platforms/dotnet/guides/winforms.md)
- [WinUI](https://docs.sentry.io/platforms/dotnet/guides/winui.md)
- [WPF](https://docs.sentry.io/platforms/dotnet/guides/wpf.md)
- [Xamarin](https://docs.sentry.io/platforms/dotnet/guides/xamarin.md)

## Topics

- [Capturing Errors](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/usage.md)
- [Enriching Events](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/enriching-events.md)
- [Extended Configuration](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/configuration.md)
- [Logs](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/logs.md)
- [Data Management](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/data-management.md)
- [Tracing](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/tracing.md)
- [Security Policy Reporting](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/security-policy-reporting.md)
- [Crons](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/crons.md)
- [Migration Guide](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/migration.md)
- [Troubleshooting](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/troubleshooting.md)
- [User Feedback](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/user-feedback.md)
- [Metrics](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/metrics.md)
- [Unit Testing](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/unit-testing.md)
- [Legacy SDK](https://docs.sentry.io/platforms/dotnet/guides/blazor-webassembly/legacy-sdk.md)
