How to use the @sentry/react-native.setTag function in @sentry/react-native

To help you get started, we’ve selected a few @sentry/react-native 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 guardian / editions / projects / Mallard / src / services / errors.ts View on Github external
private handleConsentUpdate(hasConsent: GdprSwitchSetting) {
        this.hasConsent = hasConsent
        if (hasConsent === false || hasConsent === null) return

        if (!this.hasConfigured) {
            Sentry.init({ dsn: SENTRY_DSN_URL })

            Sentry.setTag(
                'environment',
                __DEV__ ? 'DEV' : isInBeta() ? 'BETA' : 'RELEASE',
            )
            Sentry.setExtra('react', true)
            this.hasConfigured = true
        }

        while (this.pendingQueue.length > 0) {
            const err = this.pendingQueue.pop()
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            Sentry.captureException(err!)
        }
    }
github guardian / editions / projects / Apps / editionsSrc / src / services / errors.ts View on Github external
private handleConsentUpdate(hasConsent: GdprSwitchSetting) {
        this.hasConsent = hasConsent
        if (hasConsent === false || hasConsent === null) return

        if (!this.hasConfigured) {
            Sentry.init({ dsn: SENTRY_DSN_URL })

            Sentry.setTag(
                'environment',
                __DEV__ ? 'DEV' : isInBeta() ? 'BETA' : 'RELEASE',
            )
            Sentry.setExtra('react', true)
            this.hasConfigured = true
        }

        while (this.pendingQueue.length > 0) {
            const err = this.pendingQueue.pop()
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            Sentry.captureException(err!)
        }
    }
github listenzz / react-native-engineering / index.js View on Github external
import App from './app/App'
import Black from './app/Black'
import { AppState } from 'react-native'
import { commit } from './app.json'
import { ReactRegistry, Garden, Navigator } from 'react-native-navigation-hybrid'
import * as Sentry from '@sentry/react-native'
import { APPLICATION_ID, ENVIRONMENT, BUILD_TYPE, BUILD_TYPE_RELEASE } from './app/AppInfo'
import CodePush from 'react-native-code-push'

if (BUILD_TYPE === BUILD_TYPE_RELEASE) {
  Sentry.init({
    dsn: 'https://2d17bb1ffde34fec963d29b4c3a29f99@sentry.io/1446147',
    environment: ENVIRONMENT,
  })

  Sentry.setTag('commit', commit)

  CodePush.getUpdateMetadata()
    .then(update => {
      if (update) {
        Sentry.setRelease(`${APPLICATION_ID}-${update.appVersion}-codepush:${update.label}`)
      }
    })
    .catch(e => {
      Sentry.captureException(e)
    })

  CodePush.sync({
    installMode: CodePush.InstallMode.IMMEDIATE,
  })

  AppState.addEventListener('change', async state => {