|
4 | 4 |
|
5 | 5 | - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
|
6 | 6 |
|
| 7 | +## 7.81.0 |
| 8 | + |
| 9 | +### Important Changes |
| 10 | + |
| 11 | +**- feat(nextjs): Add instrumentation utility for server actions (#9553)** |
| 12 | + |
| 13 | +This release adds a utility function `withServerActionInstrumentation` to the `@sentry/nextjs` SDK for instrumenting your Next.js server actions with error and performance monitoring. |
| 14 | + |
| 15 | +You can optionally pass form data and headers to record them, and configure the wrapper to record the Server Action responses: |
| 16 | + |
| 17 | +```tsx |
| 18 | +import * as Sentry from "@sentry/nextjs"; |
| 19 | +import { headers } from "next/headers"; |
| 20 | + |
| 21 | +export default function ServerComponent() { |
| 22 | + async function myServerAction(formData: FormData) { |
| 23 | + "use server"; |
| 24 | + return await Sentry.withServerActionInstrumentation( |
| 25 | + "myServerAction", // The name you want to associate this Server Action with in Sentry |
| 26 | + { |
| 27 | + formData, // Optionally pass in the form data |
| 28 | + headers: headers(), // Optionally pass in headers |
| 29 | + recordResponse: true, // Optionally record the server action response |
| 30 | + }, |
| 31 | + async () => { |
| 32 | + // ... Your Server Action code |
| 33 | + |
| 34 | + return { name: "John Doe" }; |
| 35 | + } |
| 36 | + ); |
| 37 | + } |
| 38 | + |
| 39 | + return ( |
| 40 | + <form action={myServerAction}> |
| 41 | + <input type="text" name="some-input-value" /> |
| 42 | + <button type="submit">Run Action</button> |
| 43 | + </form> |
| 44 | + ); |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +### Other Changes |
| 49 | + |
| 50 | +- docs(feedback): Example docs on `sendFeedback` (#9560) |
| 51 | +- feat(feedback): Add `level` and remove breadcrumbs from feedback event (#9533) |
| 52 | +- feat(vercel-edge): Add fetch instrumentation (#9504) |
| 53 | +- feat(vue): Support Vue 3 lifecycle hooks in mixin options (#9578) |
| 54 | +- fix(nextjs): Download CLI binary if it can't be found (#9584) |
| 55 | +- ref: Deprecate `extractTraceParentData` from `@sentry/core` & downstream packages (#9158) |
| 56 | +- ref(replay): Add further logging to network body parsing (#9566) |
| 57 | + |
| 58 | +Work in this release contributed by @snoozbuster. Thank you for your contribution! |
| 59 | + |
7 | 60 | ## 7.80.1
|
8 | 61 |
|
9 | 62 | - fix(astro): Adjust Vite plugin config to upload server source maps (#9541)
|
|
0 commit comments