Skip to content

Commit

Permalink
migration toucan v2 -> v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jill64 committed Sep 10, 2023
1 parent 411e8d1 commit c5e7c80
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"@sentry/utils": "^7.68.0",
"@sveltejs/kit": "^1.24.1",
"esm-env": "^1.0.0",
"toucan-js": "^3.0.0"
"toucan-js": "^3.2.3"
}
}
30 changes: 15 additions & 15 deletions packages/lib/src/server/initSentry.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { isPrimitive } from '@sentry/utils'
import type { Options } from 'toucan-js'
import Toucan from 'toucan-js'
import { Toucan, RewriteFrames } from 'toucan-js'

export const initSentry = (
request: Request,
additionalOptions?: Partial<Options>
) => {
const sentry = new Toucan({
request,
allowedHeaders: [
'user-agent',
'cf-challenge',
'accept-encoding',
'accept-language',
'cf-ray',
'content-length',
'content-type',
'x-real-ip',
'host'
],
allowedSearchParams: /(.*)/,
rewriteFrames: {
root: '/'
requestDataOptions: {
allowedHeaders: [
'user-agent',
'cf-challenge',
'accept-encoding',
'accept-language',
'cf-ray',
'content-length',
'content-type',
'x-real-ip',
'host'
],
allowedSearchParams: /(.*)/
},
integrations: [new RewriteFrames({ root: '/' })],
...additionalOptions
})

Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

0 comments on commit c5e7c80

Please sign in to comment.