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

Add attachments to user feedback #49946

Closed
franNadalesDN opened this issue May 30, 2023 · 7 comments
Closed

Add attachments to user feedback #49946

franNadalesDN opened this issue May 30, 2023 · 7 comments

Comments

@franNadalesDN
Copy link

Problem Statement

I want users to be able to report issues and feedback with attachments such log files or images.

Solution Brainstorm

Use similar structure as events for User feedback.

Product Area

User Feedback

@getsantry
Copy link
Contributor

getsantry bot commented May 30, 2023

Assigning to @getsentry/support for routing, due by Tuesday, May 30th at 5:00 pm (sfo). ⏲️

@getsantry
Copy link
Contributor

getsantry bot commented May 30, 2023

Routing to @getsentry/product-owners-user-feedback for triage, due by Thursday, June 1st at 11:54 am (sfo). ⏲️

@bruno-garcia
Copy link
Member

Today the feedback you can submit with the SDK takes an event_id. So you need to capture an exception or at least a message to attach the feedback to. The same way you can use that event_id to tie attachments to it.

I believe we can improve this by letting you capture feedbacks without the need to capture an event (error/msg), and we recently did that to power our new Widget. So it's something we can look into going forward but for now I suggest using the captureMessage with Attachment + captureUserFeedback route

@billyvg
Copy link
Member

billyvg commented Mar 6, 2024

We are also adding screenshotting to our User Feedback widget: #63749

@bruno-garcia
Copy link
Member

bruno-garcia commented Mar 11, 2024

For reference the old API is: https://develop.sentry.dev/sdk/features/#user-feedback

The new API could take a local scope:

let feedback = {name:"", message:""}
Sentry.captureUserFeedback(feedback, scope => scope.addAttachment(...));

The blocker for this approach is the backend accepting the user feedback envelope together with attachments, as we allow for error events. @JoshFerge is this something you can help us with?

@ryan953
Copy link
Member

ryan953 commented Apr 30, 2024

The new/updated api to call is being implemented in getsentry/sentry-javascript#11428

It'll be available on v8.0.0 of the SDK as Sentry.captureFeedback() and will very closely align with the other captureException() and captureMessage() methods we have.

The specific method is implemented with this signature & types:

interface SendFeedbackParams {
  message: string;
  name?: string;
  email?: string;
  url?: string;
  source?: string;
  associatedEventId?: string;
}
interface EventHint {
  event_id?: string;
  captureContext?: CaptureContext;
  mechanism?: Partial<Mechanism>;
  syntheticException?: Error | null;
  originalException?: unknown;
  attachments?: Attachment[];
  data?: any;
  integrations?: string[];
}

function captureFeedback(
  feedbackParams: SendFeedbackParams,
  hint: EventHint & { includeReplay?: boolean } = {},
): string

Look out for it once #11428 lands, which should be part of 8.0.0-beta.6 and beyond.

@mydea
Copy link
Member

mydea commented May 28, 2024

Hey,

this is possible to do in v8 now - you can use it like follows:

Sentry.captureFeedback(
  { message: "I really like your App, thanks!" },
  {
    attachments: [
      {
        filename: "screenshot.png",
        data: "base64-encoded-image",
      },
    ],
  }
);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

9 participants