Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs to use the new Feedback APIs #12846

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading