-
Notifications
You must be signed in to change notification settings - Fork 93
/
_app.tsx
98 lines (91 loc) · 2.79 KB
/
_app.tsx
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import { AppProps } from "next/app";
import Head from "next/head";
import { MantineProvider, MantineThemeOverride } from "@mantine/core";
import React from "react";
import { IS_DEV } from "../utils/variables";
import * as snippet from "@segment/snippet";
import { useEffect } from "react";
import { Notifications } from "@mantine/notifications";
import { Analytics } from "@vercel/analytics/react";
import LogRocket from "logrocket";
import * as Sentry from "@sentry/browser";
if (!IS_DEV) {
Sentry.init({
dsn: "https://065aa152c4de4e14af9f9e7335c8eae4@o4505106202820608.ingest.sentry.io/4505106207735808",
release: "evaluator@1.0.0",
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1.0,
});
LogRocket.init("dyuioj/auto-evaluator");
LogRocket.getSessionURL((sessionURL) => {
Sentry.configureScope((scope) => {
scope.setExtra("sessionURL", sessionURL);
});
});
}
const renderSegmentSnippet = () => {
const opts = {
apiKey: process.env.NEXT_PUBLIC_SEGMENT_KEY,
page: true,
};
return snippet.min(opts);
};
export default function App(props: AppProps) {
const { Component, pageProps } = props;
const theme: MantineThemeOverride = {
primaryColor: "dark",
fontFamily:
"Greycliff CF, Inter,-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue,Arial, Noto Sans",
};
const pageName = "Auto-Evaluator";
useEffect(() => {
if (!IS_DEV) {
// @ts-expect-error
global.window.analytics.page();
}
}, [props]);
return (
<>
<Head>
<link rel="icon" href="favicon/favicon.ico" />
<link rel="icon" sizes="32x32" href="favicon/favicon-32x32.png" />
<link rel="icon" sizes="16x16" href="favicon/favicon-16x16.png" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link rel="icon" href="favicon/favicon.ico" />
<link rel="icon" href="favicon/favicon.ico" />
<meta
name="description"
content="Auto-Evaluator helps you evaluate your LLM apps."
/>
<meta name="og:title" content={pageName} />
<meta name="twitter:card" content="summary_large_image" />
<title>{pageName}</title>
{!IS_DEV && (
<>
<script
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: renderSegmentSnippet() }}
/>
</>
)}
</Head>
<MantineProvider
withGlobalStyles
withNormalizeCSS
theme={{
/** Put your mantine theme override here */
colorScheme: "light",
...theme,
}}
>
<Notifications />
<Component {...pageProps} />
<Analytics />
</MantineProvider>
</>
);
}