Skip to content

Commit 9345ecf

Browse files
committed
polish readme
1 parent 753f81c commit 9345ecf

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

packages/vike-react-sentry/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff 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

8393
import { getGlobalContext } from 'vike'
8494

8595
export 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

0 commit comments

Comments
 (0)