@nuux/sentry
v0.8.0
Published
Initialize Sentry from a meta tag
Downloads
30
Readme
Nuux::Sentry
Automatically configures Sentry for your Rails application.
- https://docs.sentry.io/clients/ruby/
- https://docs.sentry.io/platforms/javascript/
Installation
Add this line to your application's Gemfile:
gem "nuux-sentry", git: "https://user:[email protected]/gems/nuux-sentry.git"
And then execute:
$ bundle
Install npm package:
$ yarn add @nuux/sentry
Configuration
Rails
Define SENTRY_DSN
as environment variable.
Default configuration
Nuux::Sentry.configure do |config|
config.environments = %w[staging production]
config.user = proc { try(:current_user) }
config.user_attributes = %i[id username]
config.browser_user_attributes = config.user_attributes
config.user_context = proc { { ip_address: request.remote_ip } }
config.extra_context = {}
end
Browser
- Add
sentry_meta_tag
into theapplication
layout. - Add
import "@nuux/sentry"
injavascripts/packs/application.js
as first line.
License
The gem is available as open source under the terms of the MIT License.