Skip to content

Commit

Permalink
Fix Sentry app version
Browse files Browse the repository at this point in the history
Fixes #154
  • Loading branch information
akdasa committed Feb 18, 2023
1 parent 1d8af66 commit 2d979de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@akdasa-studios/shlokas-core": "1.0.2",
"@capacitor/app": "4.1.0",
"@capacitor/app": "^4.1.0",
"@capacitor/assets": "^2.0.4",
"@capacitor/core": "4.4.0",
"@capacitor/device": "^4.1.0",
Expand Down
14 changes: 10 additions & 4 deletions src/init/stage-0/initSentry.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
import * as Sentry from '@sentry/capacitor'
import { BrowserTracing } from '@sentry/tracing'
import * as SentrySibling from '@sentry/vue'
import { App } from '@capacitor/app'
import { InitArgs } from '../initialization'

/**
* Initialize the sentry plugin to track errors
*/
export async function initSentry({ vue }: InitArgs) {
if (process.env.NODE_ENV === 'development') {
return
if (process.env.NODE_ENV === 'development') { return }

let version = 'unknown'
try {
const info = await App.getInfo()
version = info.version
} catch (e) {
console.error('Failed to get app version', e)
}

const VERSION = process.env.npm_package_version
const DSN = 'https://e09ab355192945fb87bc01882eb62578@o257342.ingest.sentry.io/4504486578225152'

Sentry.init({
app: vue,
dsn: DSN,
release: `shlokas@${VERSION}`,
release: `shlokas@${version}`,
dist: '1',
tracesSampleRate: 1.0,
integrations: [
Expand Down

0 comments on commit 2d979de

Please sign in to comment.