← All platforms

Blazor WebAssembly error tracking

C# in the browser can throw exceptions too. The Sentry Blazor WebAssembly SDK sends the reports to Telebugs, where they stay on your server.

~/hoofnotes  dotnet add package Sentry.AspNetCore.Blazor.WebAssembly
~/hoofnotes  nvim Program.cs
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Logging;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.UseSentry(options =>
{
// Copy the complete DSN, key and path included.
options.Dsn = "YOUR_TELEBUGS_DSN";
});
builder.Logging.AddSentry(options => options.InitializeSdk = false);
await builder.Build().RunAsync();
~/hoofnotes  dotnet run

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep Sentry.AspNetCore.Blazor.WebAssembly and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Do these errors come from the browser?

Yes. This is the client-side Blazor WebAssembly integration, for managed .NET exceptions reported by the browser app. It is not native WebAssembly crash symbolication.

What about my server API?

Connect that separately with the ASP.NET Core SDK. Both sides can send their reports to your Telebugs server.