mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
28 lines
738 B
TypeScript
28 lines
738 B
TypeScript
import {
|
|
BrowserClient,
|
|
makeFetchTransport,
|
|
defaultStackParser,
|
|
getCurrentScope,
|
|
} from '@sentry/nextjs';
|
|
|
|
const dsn = process.env.SENTRY_DSN;
|
|
if (dsn) {
|
|
// To tree shake default integrations that we don't use
|
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/#tree-shaking-default-integrations
|
|
const client = new BrowserClient({
|
|
debug: false,
|
|
dsn,
|
|
integrations: [],
|
|
sampleRate: 0.1,
|
|
enableTracing: false,
|
|
beforeSendTransaction: () => {
|
|
return null;
|
|
},
|
|
transport: makeFetchTransport,
|
|
stackParser: defaultStackParser,
|
|
});
|
|
|
|
getCurrentScope().setClient(client);
|
|
client.init();
|
|
}
|