Skip to content

Commit ac6bda4

Browse files
Update MAUI docs (#6079)
1 parent 3d1f4dd commit ac6bda4

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

src/platforms/dotnet/guides/maui/index.mdx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,16 @@ Sentry has an integration for the [.NET Multi-platform App UI (MAUI)](https://do
1919
- Automatic session tracking enabled, to support [release health](/product/releases/)
2020
- ... more coming soon!
2121

22-
## Preview Status
23-
24-
The `Sentry.Maui` SDK is currently in public preview. All APIs added by this package are subject to breaking changes. We appreciate your feedback:
25-
26-
- [Main .NET MAUI Tracking Issue (GitHub)](https://github.com/getsentry/sentry-dotnet/issues/1174)
27-
- [All .NET MAUI Issues (GitHub)](https://github.com/getsentry/sentry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3AMAUI)
28-
- [New Issues or Feature Requests (GitHub)](https://github.com/getsentry/sentry-dotnet/issues/new/choose)
29-
- [Community Chat (Discord)](https://discord.com/channels/621778831602221064/621783515423440927)
30-
31-
This documentation will be updated as we get closer to general availability release.
32-
3322
## Installation
3423

3524
Add the Sentry dependency to your .NET MAUI application:
3625

3726
```shell {tabTitle:.NET Core CLI}
38-
dotnet add package Sentry.Maui --prerelease
27+
dotnet add package Sentry.Maui -v {{ packages.version('sentry.dotnet.maui') }}
3928
```
4029

4130
```powershell {tabTitle:Package Manager}
42-
Install-Package Sentry.Maui -AllowPrereleaseVersions
31+
Install-Package Sentry.Maui -Version {{ packages.version('sentry.dotnet.maui') }}
4332
```
4433

4534
This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extensions-logging/). This means that besides the MAUI related features, through this package you'll also get access to all the framework's logging integration and also the features available in the main [Sentry](/platforms/dotnet/) SDK.
@@ -48,18 +37,35 @@ This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extens
4837

4938
In your `MauiProgram.cs` file, call `UseSentry` on your `MauiAppBuilder`, and include any options you would like to set. The `Dsn` is the only required parameter.
5039

51-
For example:
52-
5340
```csharp
54-
public static MauiApp CreateMauiApp() =>
55-
MauiApp.CreateBuilder()
41+
public static MauiApp CreateMauiApp()
42+
{
43+
var builder = MauiApp.CreateBuilder();
44+
builder
5645
.UseMauiApp<App>()
46+
47+
// Add this section anywhere on the builder:
5748
.UseSentry(options =>
5849
{
50+
// The DSN is the only required setting.
5951
options.Dsn = "___PUBLIC_DSN___";
52+
53+
// Use debug mode if you want to see what the SDK is doing.
54+
// Debug messages are written to stdout with Console.Writeline,
55+
// and are viewable in your IDE's debug console or with 'adb logcat', etc.
56+
// This option is not recommended when deploying your application.
57+
options.Debug = true;
58+
59+
// Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
60+
// We recommend adjusting this value in production.
61+
options.TracesSampleRate = 1.0;
62+
63+
// Other Sentry options can be set here.
6064
})
61-
// The remainder of your configuration
62-
.Build();
65+
66+
// ... the remainder of your MAUI app setup
67+
68+
return builder.Build();
6369
}
6470
```
6571

src/wizard/dotnet/maui.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ type: framework
88
Install the **NuGet** package:
99

1010
```shell {tabTitle:.NET Core CLI}
11-
dotnet add package Sentry.Maui --prerelease
11+
dotnet add package Sentry.Maui -v {{ packages.version('sentry.dotnet.maui') }}
1212
```
1313

1414
```powershell {tabTitle:Package Manager}
15-
Install-Package Sentry.Maui -AllowPrereleaseVersions
15+
Install-Package Sentry.Maui -Version {{ packages.version('sentry.dotnet.maui') }}
1616
```
1717

1818
Then add Sentry to `MauiProgram.cs` through the `MauiAppBuilder`:

0 commit comments

Comments
 (0)