Skip to content

Commit

Permalink
Updated docs to use the new Feedback APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Feb 26, 2025
1 parent d95cbf9 commit a980fae
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/platforms/dotnet/common/user-feedback/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,40 @@ sidebar_order: 6000

When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK.

## Use the .NET SDK
## User Feedback API

<Alert>

User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#integration)** or **[ASP.NET Core](/platforms/dotnet/guides/aspnetcore/user-feedback/#integration)** supply integrations specific to supporting those SDKs.

</Alert>

You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API:
You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry.

```csharp {tabTitle:C#}
var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.");

SentrySdk.CaptureUserFeedback(eventId, "[email protected]", "It broke.", "The User");
var feedback = new SentryFeedback("It broke.", "[email protected]", "Joe Shmoe", associatedEventId: eventId);
var hint = new SentryHint();
hint.AddAttachment("c:\foo.png", AttachmentType.Default, "image/png"); // You can also add a screenshot
SentrySdk.CaptureFeedback(feedback, hint: hint);
```

```fsharp {tabTitle:F#}
open Sentry
let eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.")
SentrySdk.CaptureUserFeedback(eventId, "[email protected]", "It broke.", "The User")
let feedback = SentryFeedback("It broke.", "[email protected]", "Joe Shmoe", associatedEventId = eventId)
let hint = SentryHint()
hint.AddAttachment("c:\foo.png", AttachmentType.Default, "image/png") // You can also add a screenshot
SentrySdk.CaptureFeedback(feedback, hint)
```

Alternatively you can also use the widget, as described below.

## Crash-Report Modal

Our embeddable, JavaScript-based, Crash-Report modal is useful when you would typically render a plain error page (the classic `500.html`) on your website.
Expand Down

0 comments on commit a980fae

Please sign in to comment.