add sentry
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import * as Sentry from '@sentry/browser'
|
||||
|
||||
const sentryDsn = document.querySelector('meta[name="sentry-dsn"]')?.getAttribute('content')
|
||||
|
||||
if (sentryDsn) {
|
||||
Sentry.init({
|
||||
dsn: sentryDsn,
|
||||
beforeSend (event) {
|
||||
if (event.request.url.match(/\/[ds]\/\w+$/)) {
|
||||
event.request.url = event.request.url.slice(0, -6)
|
||||
}
|
||||
|
||||
return event
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -5,7 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= javascript_pack_tag 'application', defer: true %>
|
||||
<% if ENV['SENTRY_DSN'] %>
|
||||
<meta name="sentry-dsn" content="<%= ENV.fetch('SENTRY_DSN', nil) %>">
|
||||
<%= javascript_pack_tag 'sentry', 'application', defer: true %>
|
||||
<% else %>
|
||||
<%= javascript_pack_tag 'application', defer: true %>
|
||||
<% end %>
|
||||
<%= stylesheet_pack_tag 'application', media: 'all' %>
|
||||
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
|
||||
<%= render 'shared/plausible' if !signed_in? && ENV['PLAUSIBLE_DOMAIN'] %>
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= javascript_pack_tag 'form', defer: true %>
|
||||
<% if ENV['SENTRY_DSN'] %>
|
||||
<meta name="sentry-dsn" content="<%= ENV.fetch('SENTRY_DSN', nil) %>">
|
||||
<%= javascript_pack_tag 'sentry', 'form', defer: true %>
|
||||
<% else %>
|
||||
<%= javascript_pack_tag 'form', defer: true %>
|
||||
<% end %>
|
||||
<%= stylesheet_pack_tag 'form', media: 'all' %>
|
||||
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
|
||||
</head>
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= javascript_pack_tag 'application', defer: true %>
|
||||
<% if ENV['SENTRY_DSN'] %>
|
||||
<meta name="sentry-dsn" content="<%= ENV.fetch('SENTRY_DSN', nil) %>">
|
||||
<%= javascript_pack_tag 'sentry', 'application', defer: true %>
|
||||
<% else %>
|
||||
<%= javascript_pack_tag 'application', defer: true %>
|
||||
<% end %>
|
||||
<%= stylesheet_pack_tag 'application', media: 'all' %>
|
||||
<%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user