How to use the raven-js.setTagsContext function in raven-js

To help you get started, we’ve selected a few raven-js 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 simon-weber / Autoplaylists-for-Google-Music / src / js / reporting.js View on Github external
function setContext(isBackground, context) {
  console.log('setting context:', isBackground, context);

  cachedContext = context;

  GATracker.set('userId', context.reportingUUID);
  GATracker.set('dimension1', context.tags.hasFullVersion ? 'full' : 'free');
  GATracker.set('dimension2', context.tags.isDeveloper ? 'yes' : 'no');
  GATracker.set('dimension5', context.tags.licenseState);

  Raven.setUserContext(context.user);
  context.tags.isBackground = isBackground; // eslint-disable-line no-param-reassign
  Raven.setTagsContext(context.tags);
}
github simon-weber / Autoplaylists-for-Google-Music / src / js / reporting.js View on Github external
function setContext(isBackground, context) {
  console.log('setting context:', isBackground, context);

  cachedContext = context;

  GATracker.set('userId', context.reportingUUID);
  GATracker.set('dimension1', context.tags.hasFullVersion ? 'full' : 'free');
  GATracker.set('dimension2', context.tags.isDeveloper ? 'yes' : 'no');

  Raven.setUserContext(context.user);
  context.tags.isBackground = isBackground; // eslint-disable-line no-param-reassign
  Raven.setTagsContext(context.tags);
}
github csegames / Camelot-Unchained / game / hud / src / sentry.tsx View on Github external
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import Raven from 'raven-js';

if (process.env.ENABLE_SENTRY) {
  Raven.config('https://f7710348f19c4a0f8f8cd83ea0aa343f@sentry.io/1259561', {
    release: process.env.GIT_REVISION, // use git revision as release? {{process.env.GIT_REVISION}}
    environment: 'development-test',
    tags: {
      module: process.env.NAME,
    },
  }).install();

  if (game) {
    Raven.setTagsContext({
      shard: game.shardID,
    });
    Raven.setUserContext({
      id: game.selfPlayerState.characterID,
    });
  }
  setTimeout(() => {
    Raven.setTagsContext({
      shard: game.shardID,
    });
    Raven.setUserContext({
      id: game.selfPlayerState.characterID,
    });
  }, 1000);
}
github ProtonMail / WebClient / src / app / bugReport / services / bugReportApi.js View on Github external
ROW_MODE,
    COLUMN_MODE,
    MESSAGE_VIEW_MODE,
    CONVERSATION_VIEW_MODE,
    CLIENT_TYPE,
    MAX_SIZE_SCREENSHOT
} from '../../constants';
import CONFIG from '../../config';
import { getOS, getBrowser, getDevice } from '../../../helpers/browser';
import { toBase64 } from '../../../helpers/fileHelper';
import { downSize, toBlob } from '../../../helpers/imageHelper';

Raven.config(CONFIG.sentry.sentry, {
    release: CONFIG.sentry.release
}).install();
Raven.setTagsContext({
    appVersion: CONFIG.app_version
});

/* @ngInject */
function bugReportApi(
    Report,
    $state,
    addressesModel,
    authentication,
    gettextCatalog,
    networkActivityTracker,
    notification
) {
    const MAP_MODE = {
        layout: {
            [ROW_MODE]: 'row',
github expo / snack-web / src / client / components / App.tsx View on Github external
componentDidMount() {
    if (window.location.host.includes('expo.io')) {
      Raven.config('https://6501f7d527764d85b045b0ce31927c75@sentry.io/191351').install();
      const build_date = new Date(process.env.BUILD_TIMESTAMP || 0).toUTCString();
      Raven.setTagsContext({ build_date });
      Segment.getInstance().identify({ build_date });
    }

    if (this.state.wasUpgraded) {
      Segment.getInstance().logEvent('LOADED_UNSUPPORTED_VERSION', {
        requestedVersion: this.state.initialSdkVersion,
        snackId: this.props.match.params.id,
      });
    }

    // @ts-ignore
    this._snackSessionWorker = new Worker('../workers/snack-session.worker', { type: 'module' });
    this._snack = create(this._snackSessionWorker);

    this._initializeSnackSession();
github DefinitelyTyped / DefinitelyTyped / raven-js / raven-js-tests.ts View on Github external
id: '123'
});

RavenJS.captureMessage('Broken!');
RavenJS.captureMessage('Broken!', {tags: { key: "value" }});

RavenJS.showReportDialog({
    eventId: 0815,
    dsn:'1337asdf',
    user: {
        name: 'DefenitelyTyped',
        email: 'df@ts.ms'
    }
});

RavenJS.setTagsContext({ key: "value" });

RavenJS.setExtraContext({ foo: "bar" });
github getsentry / sentry-javascript / packages / browser / lib / SentryBrowser.ts View on Github external
public async setTagsContext(tags?: { [key: string]: any }) {
    Raven.setTagsContext(tags);
    return this;
  }
github cyverse / troposphere / troposphere / static / js / components / Master.jsx View on Github external
loadRavenData: function() {
        let profile = context.profile;
        let userContext = {
            id: profile.get("user"),
            email: profile.get("email"),
            username: profile.get("username")
        };

        if (context.hasEmulatedSession()) {
            userContext.emulated = true;
            userContext.emulator = context.getEmulator();
        }

        Raven.setUserContext(userContext);
        Raven.setTagsContext(window.SENTRY_TAGS);
    },
github department-of-veterans-affairs / vets-website / src / platform / user / authentication / utilities.js View on Github external
export function clearRavenLoginType() {
  Raven.setTagsContext({ loginType: undefined });
}