-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathinstrumentation-client.ts
More file actions
57 lines (54 loc) · 2.32 KB
/
Copy pathinstrumentation-client.ts
File metadata and controls
57 lines (54 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import * as Sentry from "@sentry/nextjs";
// The feedback dialog is built by Sentry outside React, so it can't reach
// next-intl's messages. `<html lang>` is server-rendered and therefore already
// correct by the time this module executes.
const isSpanish =
typeof document !== "undefined" &&
document.documentElement.lang.toLowerCase().startsWith("es");
const feedbackText = isSpanish
? {
formTitle: "Reportar un problema",
submitButtonLabel: "Enviar reporte",
cancelButtonLabel: "Cancelar",
confirmButtonLabel: "Confirmar",
nameLabel: "Nombre",
namePlaceholder: "Tu nombre",
emailLabel: "Correo",
emailPlaceholder: "tu@correo.com",
messageLabel: "Qué pasó",
messagePlaceholder: "Cuéntanos qué esperabas y qué ocurrió en su lugar.",
isRequiredLabel: "(obligatorio)",
addScreenshotButtonLabel: "Añadir captura",
removeScreenshotButtonLabel: "Quitar captura",
successMessageText: "Gracias, recibimos tu reporte.",
errorEmptyMessageText: "Escribe una descripción antes de enviar.",
errorGenericText: "No pudimos enviar el reporte. Inténtalo de nuevo.",
errorTimeoutText: "El envío tardó demasiado. Inténtalo de nuevo.",
}
: {
formTitle: "Report a problem",
submitButtonLabel: "Send report",
messageLabel: "What happened",
messagePlaceholder: "Tell us what you expected and what happened instead.",
successMessageText: "Thanks, we got your report.",
errorEmptyMessageText: "Add a description before sending.",
};
Sentry.init({
dsn: "https://e40fdc0a3e5965c1862e6594a8c2631f@o4507789962706944.ingest.us.sentry.io/4507789965721600",
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [
Sentry.replayIntegration(),
Sentry.feedbackIntegration({
// No auto-injected actor button. The SDK plants a fixed bottom-right puck,
// which sat directly on top of the lesson footer's "Next" button on mobile.
// `components/shared/feedback-button.tsx` renders a draggable trigger
// instead, and `components/user-nav.tsx` offers a menu entry that costs no
// screen space at all. Both open the dialog via `lib/sentry/feedback.ts`.
autoInject: false,
colorScheme: "system",
...feedbackText,
}),
],
});