Sentry - Solutions-Needed/solutions-needed GitHub Wiki

Sentry

Developed using Nextjs

Configuration

Using yarn:

yarn add @sentry/react @sentry/tracing

Initialization

You need to import and initialize the Sentry module. Create a sentry.jsx file in the project root with the following code:

import React from "react";
import ReactDOM from "react-dom";
import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import App from "./App";

Sentry.init({
  dsn: "Project URL",
  integrations: [
    new Integrations.BrowserTracing(),
  ],

  // We recommend adjusting this value in production, or using tracesSampler
  // for finer control
  tracesSampleRate: 1.0, //To reduce the volume of performance data captured, change tracesSampleRate to a value between 0 and 1.
});

ReactDOM.render(<App />, document.getElementById("root"));

// Can also use with React Concurrent Mode
// ReactDOM.createRoot(document.getElementById('root')).render(<App />);

Usage

You can trigger your first event from your development environment by raising an exception somewhere within your application. An example of this would be rendering a button whose onClick handler attempts to invoke a method that does not exist:

return <button onClick={methodDoesNotExist}>Break the world</button>;
⚠️ **GitHub.com Fallback** ⚠️