Skip to content

Commit 2ed28e2

Browse files
committed
Remove one more occurence of withSentry
1 parent 37c5aa9 commit 2ed28e2

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

src/wizard/javascript/nextjs.md

+8-21
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,19 @@ npx @sentry/wizard -i nextjs
2121
```
2222

2323
Sentry wizard will automatically patch your application:
24+
2425
- create `sentry.client.config.js` and `sentry.server.config.js` with the default `Sentry.init`.
2526
- create `next.config.js` with the default configuration.
2627
- create `sentry.properties` with configuration for sentry-cli (which is used when automatically uploading source maps).
2728

28-
2929
You can also [configure it manually](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/).
3030

31-
32-
## Nextjs API routes
33-
While `@sentry/nextjs` will enable Sentry for your nextjs application, files under the `pages/api` require one additional installing step.
34-
35-
Wrap your API handlers with a `withSentry` function to capture [Next.js API route errors](https://nextjs.org/docs/api-routes/introduction):
36-
37-
```javascript
38-
import { withSentry } from '@sentry/nextjs';
39-
40-
const handler = async (req, res) => {
41-
// ...
42-
}
43-
44-
export default withSentry(handler);
45-
```
46-
4731
Configure the Sentry initialization:
4832

4933
```javascript
5034
Sentry.init({
5135
dsn: "___PUBLIC_DSN___",
52-
36+
5337
// Set tracesSampleRate to 1.0 to capture 100%
5438
// of transactions for performance monitoring.
5539
// We recommend adjusting this value in production
@@ -62,10 +46,13 @@ The above configuration has automatic error tracking with source maps for both J
6246
Then create an intentional error, so you can test that everything is working from your development environment. For example, a button whose `onClick` handler throws an error:
6347

6448
```javascript
65-
<button type="button" onClick={() => {
49+
<button
50+
type="button"
51+
onClick={() => {
6652
throw new Error("Sentry Frontend Error");
67-
}}>
68-
Throw error
53+
}}
54+
>
55+
Throw error
6956
</button>
7057
```
7158

0 commit comments

Comments
 (0)