How to use @sentry/react - 2 common examples

To help you get started, we’ve selected a few @sentry/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hlcfan / pokr / app / javascript / packs / room_app.js View on Github external
// import Rails from "@rails/ujs"
// import Turbolinks from "turbolinks"
// import * as ActiveStorage from "@rails/activestorage"
// import "channels"

// Rails.start()
// Turbolinks.start()
// ActiveStorage.start()

import ReactDOM from 'react-dom'
import React from 'react'
import Room from './bundles/Room/containers/Room'
import * as Sentry from "@sentry/react"
import { Integrations } from "@sentry/tracing"

Sentry.init({
  dsn: "https://e1070f75c7b24052a1784b4ce297b9e2@o100957.ingest.sentry.io/221730",
  release: "my-project-name@" + process.env.npm_package_version,
  integrations: [new Integrations.BrowserTracing()],

  // We recommend adjusting this value in production, or using tracesSampler
  // for finer control
  tracesSampleRate: 1.0,
});

document.addEventListener('DOMContentLoaded', () => {
  roomId = document.querySelector("#roomId").value
  roomName = document.querySelector("#roomName").value
  role = document.querySelector("#role").value
  currentVote = document.querySelector("#currentVote").value
  roomState = document.querySelector("#roomState").value
  pointValues = JSON.parse(document.querySelector("#pointValues").value)
github aergonaut / cody / app / javascript / packs / pulls_app.jsx View on Github external
import React from "react";
import ReactDOM from "react-dom";
import * as Sentry from "@sentry/react";
import App from "pulls/components/App";

Sentry.init({
  dsn:
    "https://b11af8b7e6ca4e529fd920dfffd68bd0@o80496.ingest.sentry.io/176187",
});

document.addEventListener("DOMContentLoaded", () => {
  const root = document.getElementById("pull_request_mount");
  if (root) {
    ReactDOM.render(, root);
  }
});

@sentry/react

Official Sentry SDK for React.js

MIT
Latest version published 4 days ago

Package Health Score

95 / 100
Full package analysis

Popular @sentry/react functions

Similar packages