File tree Expand file tree Collapse file tree
packages/vike-react-sentry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,15 +78,25 @@ Sentry SDK configuration options.
7878// pages/+sentry.js
7979// Environment: client, server
8080
81- // Shared configuration (client & server)
81+ export default {
82+ tracesSampleRate: 1.0 ,
83+ debug: true ,
84+ )
85+ ` ` `
86+
87+ You can return a function and access [` globalContext` ](https://vike.dev/globalContext):
88+
89+ ` ` ` js
90+ // pages/+sentry.js
91+ // Environment: client, server
8292
8393import { getGlobalContext } from ' vike'
8494
8595export default async () => {
8696 const globalContext = await getGlobalContext ()
8797 return {
88- tracesSampleRate: 1.0 , // Capture 100% of transactions for tracing
89- debug: true , // Enable debug mode during development
98+ tracesSampleRate: 1.0 ,
99+ debug: true ,
90100 environment: globalContext .isProduction ? ' production' : ' development' ,
91101 }
92102)
@@ -95,6 +105,8 @@ export default async () => {
95105> [!NOTE]
96106> See also: [Vike > ` getGlobalContext ()` ](https://vike.dev/getGlobalContext)
97107
108+ You can define settings only on the client- or server-side:
109+
98110` ` ` js
99111// pages/+sentry.client.js
100112// Environment: client
You can’t perform that action at this time.
0 commit comments