MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / captureFeedback

Function captureFeedback

packages/core/src/feedback.ts:8–40  ·  view source on GitHub ↗
(
  params: SendFeedbackParams,
  hint: EventHint & { includeReplay?: boolean } = {},
  scope = getCurrentScope(),
)

Source from the content-addressed store, hash-verified

6 * Send user feedback to Sentry.
7 */
8export function captureFeedback(
9 params: SendFeedbackParams,
10 hint: EventHint & { includeReplay?: boolean } = {},
11 scope = getCurrentScope(),
12): string {
13 const { message, name, email, url, source, associatedEventId, tags } = params;
14
15 const feedbackEvent: FeedbackEvent = {
16 contexts: {
17 feedback: {
18 contact_email: email,
19 name,
20 message,
21 url,
22 source,
23 associated_event_id: associatedEventId,
24 },
25 },
26 type: 'feedback',
27 level: 'info',
28 tags,
29 };
30
31 const client = scope?.getClient() || getClient();
32
33 if (client) {
34 client.emit('beforeSendFeedback', feedbackEvent, hint);
35 }
36
37 const eventId = scope.captureEvent(feedbackEvent, hint);
38
39 return eventId;
40}

Callers 2

feedback.test.tsFile · 0.90
sendFeedbackFunction · 0.90

Calls 5

getCurrentScopeFunction · 0.90
getClientFunction · 0.90
emitMethod · 0.65
getClientMethod · 0.45
captureEventMethod · 0.45

Tested by

no test coverage detected