Skip to content

Instantly share code, notes, and snippets.

@feelitloveit
Created October 17, 2019 11:24
Show Gist options
  • Save feelitloveit/804abf60244e9ad26bb45487bd00f685 to your computer and use it in GitHub Desktop.
Save feelitloveit/804abf60244e9ad26bb45487bd00f685 to your computer and use it in GitHub Desktop.
Sentry.io Implement
# Create a sentry Account
https://sentry.io
# Create a new Project
# choose browser => angularJS
# Install the depencency
npm install raven-js
# Init raven with angularjs plugin
# Use your project logging U RL
const Raven = require('raven-js');
Raven
.config(settings.logging.sentry.url)
.addPlugin(require('raven-js/plugins/angular'), angular)
.setEnvironment(settings.environment)
.setRelease(settings.projectVersion)
.install();
# Add user context when available
# Raven is available as depenency injection in AngularJS
Raven.setUserContext({
username: state.user.me.username,
id: state.user.me.key
});
projectVersion: '#{version}',
environment: '#{env}',
logging: {
sentry: {
url: '#{sentry_url}'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment