You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/unity/user-feedback/index.mdx
+42-7Lines changed: 42 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,56 @@ description: "Learn more about collecting user feedback when an event occurs. Se
5
5
sidebar_order: 6000
6
6
---
7
7
8
-
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.
8
+
<Alertlevel="info">
9
9
10
-
## Use the .NET SDK
10
+
The User Feedback Prefab is available in version `4.0.0` of the Sentry SDK for Unity, which is currently in beta.
11
11
12
-
<Alert>
12
+
</Alert>
13
13
14
-
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.
14
+
When a user experiences an error, Sentry provides the ability to collect additional feedback. The Unity SDK provides both a simple prefab-based solution and a programmatic API for collecting user feedback.
15
15
16
-
</Alert>
16
+
## Use the User Feedback Prefab
17
+
18
+
The Unity SDK includes a ready-to-use prefab that provides a complete user feedback solution. This prefab contains:
19
+
20
+
- A feedback button (megaphone icon) that opens the feedback form
21
+
- A feedback form with fields for:
22
+
- Name (optional)
23
+
- Email (optional)
24
+
- Message/feedback (required)
25
+
- Screenshot (optional, taken automatically)
26
+
27
+
### Adding the Prefab to Your Scene
28
+
29
+
To add the prefab, drag and drop the User Feedback prefab from the Unity SDK package into any scene. The prefab is ready to use immediately without any additional configuration, and includes a scaling canvas that works across different screen sizes and resolutions.
30
+
31
+
### Default Appearance
32
+
33
+
The User Feedback prefab includes a megaphone button that triggers the feedback form:
17
34
18
-
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 web frontend, you can use this API:
35
+

36
+
37
+
When clicked, the feedback form appears with fields for user input:
38
+
39
+

40
+
41
+
### Customization
42
+
43
+
You can customize the feedback form by:
44
+
45
+
- Creating a prefab variant to inherit from the original while allowing updates
46
+
- Removing optional fields (name, email) by deleting them from the VerticalLayoutGroup
47
+
- Modifying the appearance and styling of the form elements
48
+
- The prefab comes with a custom inspector that highlights missing or broken references:
49
+
- Missing optional fields are highlighted in yellow
50
+
- Missing required fields are highlighted in red
51
+
52
+
## Use the .NET SDK API
53
+
54
+
If you prefer to create your own feedback form or need programmatic control, you can use the SDK's API to send feedback to Sentry:
19
55
20
56
```csharp {tabTitle:C#}
21
57
vareventId=SentrySdk.CaptureMessage("An event that will receive user feedback.");
22
58
23
59
SentrySdk.CaptureFeedback("It broke.", "[email protected]", "The User", associatedEventId: eventId);
0 commit comments