Grab the Sentry JavaScript SDK:
npm install @sentry/react
or
yarn add @sentry/react
Configure your SDK:
import React from "react";
import ReactDOM from "react-dom";
import * as Sentry from "@sentry/react";
import App from "./App";
Sentry.init({
dsn: "__PUBLIC_DSN__"
});
ReactDOM.render(<App />, document.getElementById("root"));
That’s it! Check out the Sentry for JavaScript and React integration documentation for more information.